|
Cataclysm DDA
|
A vehicle as a whole with all its components. More...
#include <vehicle.h>
Classes | |
| class | autodrive_controller |
| struct | rackable_vehicle |
| struct | unrackable_vehicle |
Public Member Functions | |
| std::map< vehicle *, float > | search_connected_vehicles () |
| Returns a map of connected vehicle pointers to power loss factor: Keys are vehicles connected by POWER_TRANSFER parts, includes self Values are line loss, 0.01 corresponds to 1% charge loss to wire resistance May load the connected vehicles' submaps Templated to support const and non-const vehicle*. More... | |
| std::map< const vehicle *, float > | search_connected_vehicles () const |
| Returns a map of connected vehicle pointers to power loss factor: Keys are vehicles connected by POWER_TRANSFER parts, includes self Values are line loss, 0.01 corresponds to 1% charge loss to wire resistance May load the connected vehicles' submaps Templated to support const and non-const vehicle*. More... | |
| void | get_connected_vehicles (std::unordered_set< vehicle * > &dest) |
| Returns a map of connected vehicle pointers to power loss factor: Keys are vehicles connected by POWER_TRANSFER parts, includes self Values are line loss, 0.01 corresponds to 1% charge loss to wire resistance May load the connected vehicles' submaps Templated to support const and non-const vehicle*. More... | |
| std::map< vpart_reference, float > | search_connected_batteries () |
| Returns a map of connected battery references to power loss factor Keys are batteries in vehicles (includes self) connected by POWER_TRANSFER parts Values are line loss, 0.01 corresponds to 1% charge loss to wire resistance May load the connected vehicles' submaps. More... | |
| vehicle (const vproto_id &proto_id) | |
| vehicle (const vehicle &)=delete | |
| ~vehicle () | |
| vehicle & | operator= (vehicle &&)=default |
| void | suspend_refresh () |
| Disable or enable refresh() ; used to speed up performance when creating a vehicle. More... | |
| void | enable_refresh () |
| void | refresh (bool remove_fakes=true) |
| Refreshes all caches and refinds all parts. More... | |
| void | refresh_active_item_cache () |
| safe_reference< vehicle > | get_safe_reference () |
| Return a pointer-like type that's automatically invalidated if this item is destroyed or assigned-to. More... | |
| void | set_hp (vehicle_part &pt, int qty, bool keep_degradation, int new_degradation=-1) |
| Set stat for part constrained by range [0,durability]. More... | |
| bool | mod_hp (vehicle_part &pt, int qty) |
| Apply damage to part constrained by range [0,durability] possibly destroying it. More... | |
| bool | player_in_control (const Character &p) const |
| bool | remote_controlled (const Character &p) const |
| void | init_state (map &placed_on, int init_veh_fuel, int init_veh_status) |
| void | smash (map &m, float hp_percent_loss_min=0.1f, float hp_percent_loss_max=1.2f, float percent_of_parts_to_affect=1.0f, point damage_origin=point_zero, float damage_size=0) |
| Smashes up a vehicle that has already been placed; used for generating very damaged vehicles. More... | |
| void | serialize (JsonOut &json) const |
| void | deserialize (const JsonObject &data) |
| void | deserialize_parts (const JsonArray &data) |
| int | print_part_list (const catacurses::window &win, int y1, int max_y, int width, int p, int hl=-1, bool detail=false, bool include_fakes=true) const |
| Prints a list of all parts to the screen inside of a boxed window, possibly highlighting a selected one. More... | |
| void | print_vparts_descs (const catacurses::window &win, int max_y, int width, int p, int &start_at, int &start_limit) const |
| Prints a list of descriptions for all parts to the screen inside of a boxed window. More... | |
| void | invalidate_towing (bool first_vehicle=false, Character *remover=nullptr) |
| void | do_towing_move () |
| bool | tow_cable_too_far () const |
| bool | no_towing_slack () const |
| bool | is_towing () const |
| bool | has_tow_attached () const |
| int | get_tow_part () const |
| bool | is_external_part (const tripoint &part_pt) const |
| bool | is_towed () const |
| void | set_tow_directions () |
| bool | is_appliance () const |
| bool | is_owned_by (const Character &c, bool available_to_take=false) const |
| bool | is_old_owner (const Character &c, bool available_to_take=false) const |
| std::string | get_owner_name () const |
| void | set_old_owner (const faction_id &temp_owner) |
| void | remove_old_owner () |
| void | set_owner (const faction_id &new_owner) |
| void | set_owner (const Character &c) |
| faction_id | get_owner () const |
| faction_id | get_old_owner () const |
| bool | has_owner () const |
| bool | has_old_owner () const |
| bool | handle_potential_theft (Character const &you, bool check_only=false, bool prompt=true) |
| std::set< point > | immediate_path (const units::angle &rotate=0_degrees) |
| void | autopilot_patrol () |
| units::angle | get_angle_from_targ (const tripoint &targ) const |
| void | drive_to_local_target (const tripoint &target, bool follow_protocol) |
| autodrive_result | do_autodrive (Character &driver) |
| void | stop_autodriving (bool apply_brakes=true) |
| void | connect (const tripoint &source_pos, const tripoint &target_pos) |
| bool | precollision_check (units::angle &angle, map &here, bool follow_protocol) |
| bool | auto_select_fuel (vehicle_part &vp) |
| bool | start_engine (vehicle_part &vp) |
| void | stop_engines () |
| void | start_engines (bool take_control=false, bool autodrive=false) |
| void | backfire (const vehicle_part &vp) const |
| ret_val< void > | can_mount (const point &dp, const vpart_info &vpi) const |
| ret_val< void > | can_unmount (const vehicle_part &vp_to_remove, bool allow_splits=false) const |
| int | install_part (const point &dp, const vpart_id &type) |
| int | install_part (const point &dp, const vpart_id &type, item &&base) |
| int | install_part (const point &dp, const vpart_id &type, item &&base, std::vector< item > &installed_with) |
| int | install_part (const point &dp, vehicle_part &&vp) |
| std::vector< rackable_vehicle > | find_vehicles_to_rack (int rack) const |
| std::vector< unrackable_vehicle > | find_vehicles_to_unrack (int rack) const |
| bool | merge_rackable_vehicle (vehicle *carry_veh, const std::vector< int > &rack_parts) |
| bool | merge_vehicle_parts (vehicle *veh) |
| bool | merge_appliance_into_grid (vehicle &veh_target) |
| void | separate_from_grid (point mount) |
| bool | is_powergrid () const |
| bool | remove_part (vehicle_part &vp) |
| Mark a part as removed from the vehicle. More... | |
| bool | remove_part (vehicle_part &vp, RemovePartHandler &handler) |
| void | part_removal_cleanup () |
| bool | do_remove_part_actual () |
| bool | remove_carried_vehicle (const std::vector< int > &carried_parts, const std::vector< int > &racks) |
| bool | find_and_split_vehicles (map &here, std::set< int > exclude) |
| void | relocate_passengers (const std::vector< Character * > &passengers) const |
| bool | split_vehicles (map &here, const std::vector< std::vector< int >> &new_vehs, const std::vector< vehicle * > &new_vehicles, const std::vector< std::vector< point >> &new_mounts, std::vector< vehicle * > *added_vehicles=nullptr) |
| item_location | part_base (int p) |
| Get handle for base item of part. More... | |
| std::optional< vpart_reference > | get_remote_part (const vehicle_part &vp_local) const |
| Get the remote vehicle and part that a part is targeting. More... | |
| void | remove_remote_part (const vehicle_part &vp_local) const |
| Remove the part on a targeted remote vehicle that a part is targeting. More... | |
| vehicle_part_range | get_all_parts () const |
| Yields a range containing all parts (including broken ones) that can be iterated over. More... | |
| vehicle_part_with_fakes_range | get_all_parts_with_fakes (bool with_inactive=false) const |
| std::vector< int > | parts_at_relative (const point &dp, bool use_cache, bool include_fake=false) const |
| int | part_with_feature (const point &pt, const std::string &f, bool unbroken) const |
Returns index of part at mount point pt which has given f flag. More... | |
| int | part_with_feature (const point &pt, vpart_bitflags f, bool unbroken) const |
Returns part index at mount point pt which has given f flag. More... | |
| int | part_with_feature (int p, vpart_bitflags f, bool unbroken) const |
Returns p or part index at mount point pt which has given f flag. More... | |
| int | avail_part_with_feature (const point &pt, const std::string &f) const |
Returns index of part at mount point pt which has given f flag and is_available(), or -1 if no such part or it's not is_available() More... | |
| int | avail_part_with_feature (int p, vpart_bitflags f) const |
Returns p or part index at mount point pt which has given f flag and is_available(), or -1 if no such part or it's not is_available() More... | |
| int | avail_linkable_part (const point &pt, bool to_ports) const |
Returns index of part at mount point pt which has link connection and is_available(), or -1 if no such part or it's not is_available() More... | |
| bool | has_part (const std::string &flag, bool enabled=false) const |
| Check if vehicle has at least one unbroken part with specified flag. More... | |
| bool | has_part (const tripoint &pos, const std::string &flag, bool enabled=false) const |
| Check if vehicle has at least one unbroken part with specified flag. More... | |
| std::vector< vehicle_part * > | get_parts_at (const tripoint &pos, const std::string &flag, part_status_flag condition) |
| Get all enabled, available, unbroken vehicle parts at specified position. More... | |
| std::vector< vehicle_part * > | get_parts_at (const tripoint_bub_ms &pos, const std::string &flag, part_status_flag condition) |
| std::vector< const vehicle_part * > | get_parts_at (const tripoint &pos, const std::string &flag, part_status_flag condition) const |
| bool | can_enable (const vehicle_part &pt, bool alert=false) const |
| Test if part can be enabled (unbroken, sufficient fuel etc), optionally displaying failures to user. More... | |
| int | next_part_to_open (int p, bool outside=false) const |
Return the index of the next part to open at p's location. More... | |
| int | next_part_to_close (int p, bool outside=false) const |
Return the index of the next part to close at p More... | |
| int | next_part_to_lock (int p, bool outside=false) const |
Return the index of the next part to lock at part p's location. More... | |
| int | next_part_to_unlock (int p, bool outside=false) const |
Return the index of the next part to unlock at part p's location. More... | |
| std::vector< int > | all_parts_at_location (const std::string &location) const |
| Returns all parts in the vehicle that exist in the given location slot. More... | |
| int | get_next_shifted_index (int original_index, Character &you) const |
| std::vector< std::vector< int > > | find_lines_of_parts (int part, const std::string &flag) const |
| Returns all parts in the vehicle that have the specified flag in their vpinfo and are on the same X-axis or Y-axis as the input part and are contiguous with each other. More... | |
| point | coord_translate (const point &p) const |
| void | coord_translate (const units::angle &dir, const point &pivot, const point &p, tripoint &q) const |
| void | coord_translate (tileray tdir, const point &pivot, const point &p, tripoint &q) const |
| tripoint | mount_to_tripoint (const point &mount) const |
| tripoint | mount_to_tripoint (const point &mount, const point &offset) const |
| int | part_at (const point &dp) const |
| int | part_displayed_at (const point &dp, bool include_fake=false, bool below_roof=true, bool roof=true) const |
| Returns which part (as an index into the parts list) is the one that will be displayed for the given square. More... | |
| int | roof_at_part (int p) const |
| int | index_of_part (const vehicle_part *part, bool include_removed=false) const |
| vpart_display | get_display_of_tile (const point &dp, bool rotate=true, bool include_fake=true, bool below_roof=true, bool roof=true) const |
| std::vector< itype_id > | get_printable_fuel_types () const |
| Returns an array of fuel types that can be printed. More... | |
| void | print_fuel_indicators (const catacurses::window &win, const point &, int start_index=0, bool fullsize=false, bool verbose=false, bool desc=false, bool isHorizontal=false) |
| Prints all of the fuel indicators of the vehicle. More... | |
| void | print_speed_gauge (const catacurses::window &win, const point &, int spacing=0) const |
| Vehicle speed gauge. More... | |
| void | precalc_mounts (int idir, const units::angle &dir, const point &pivot) |
| std::vector< int > | boarded_parts () const |
| std::vector< rider_data > | get_riders () const |
| bool | is_passenger (Character &c) const |
| Character * | get_passenger (int you) const |
| monster * | get_monster (int p) const |
| bool | enclosed_at (const tripoint &pos) |
| tripoint_abs_ms | global_square_location () const |
| tripoint_abs_omt | global_omt_location () const |
| tripoint | global_pos3 () const |
| tripoint_bub_ms | pos_bub () const |
| tripoint | global_part_pos3 (const int &index) const |
| Get the coordinates of the studied part of the vehicle. More... | |
| tripoint | global_part_pos3 (const vehicle_part &pt) const |
| tripoint_bub_ms | bub_part_pos (int index) const |
| tripoint_bub_ms | bub_part_pos (const vehicle_part &pt) const |
| std::map< itype_id, int > | fuels_left () const |
| All the fuels that are in all the tanks in the vehicle, nicely summed up. More... | |
| std::list< item * > | fuel_items_left () |
| All the individual fuel items that are in all the tanks in the vehicle. More... | |
| int64_t | fuel_left (const itype_id &ftype, const std::function< bool(const vehicle_part &)> &filter=return_true< const vehicle_part & >) const |
| int | engine_fuel_left (const vehicle_part &vp) const |
| int | fuel_capacity (const itype_id &ftype) const |
| int | drain (const itype_id &ftype, int amount, const std::function< bool(vehicle_part &)> &filter=return_true< vehicle_part & >, bool apply_loss=true) |
| int | drain (int index, int amount, bool apply_loss=true) |
| units::energy | drain_energy (const itype_id &ftype, units::energy wanted_energy) |
| Consumes enough fuel by energy content. More... | |
| units::power | basic_consumption (const itype_id &ftype) const |
| int | consumption_per_hour (const itype_id &ftype, units::energy fuel_per_s) const |
| void | consume_fuel (int load, bool idling) |
| std::map< itype_id, units::power > | fuel_usage () const |
| Maps used fuel to its basic (unscaled by load/strain) consumption. More... | |
| units::power | engine_fuel_usage (const vehicle_part &vp) const |
| Fuel usage for specific engine. More... | |
| std::vector< vehicle_part * > | lights () |
| void | update_alternator_load () |
| units::power | total_engine_epower () const |
| units::power | total_alternator_epower () const |
| units::power | total_solar_epower () const |
| units::power | total_wind_epower () const |
| units::power | total_water_wheel_epower () const |
| units::power | total_accessory_epower () const |
| units::power | net_battery_charge_rate (bool include_reactors) const |
| units::power | max_reactor_epower () const |
| units::power | active_reactor_epower () const |
| void | power_parts () |
| std::pair< int, int > | battery_power_level () const |
| std::pair< int, int > | connected_battery_power_level () const |
| int64_t | battery_left (bool apply_loss=true) const |
| int | charge_battery (int amount, bool apply_loss=true) |
| Charges batteries in connected vehicles/appliances. More... | |
| int | discharge_battery (int amount, bool apply_loss=true) |
| Discharges batteries in connected vehicles/appliances. More... | |
| void | invalidate_mass () |
| Mark mass caches and pivot cache as dirty. More... | |
| units::mass | total_mass () const |
| const point & | rotated_center_of_mass () const |
| const point & | local_center_of_mass () const |
| const point & | pivot_point () const |
| point | pivot_displacement () const |
| units::power | total_power (bool fueled=true, bool safe=false) const |
| int | ground_acceleration (bool fueled=true, int at_vel_in_vmi=-1) const |
| int | water_acceleration (bool fueled=true, int at_vel_in_vmi=-1) const |
| int | rotor_acceleration (bool fueled=true, int at_vel_in_vmi=-1) const |
| int | acceleration (bool fueled=true, int at_vel_in_vmi=-1) const |
| int | current_acceleration (bool fueled=true) const |
| bool | is_moving () const |
| bool | can_use_rails () const |
| int | max_ground_velocity (bool fueled=true) const |
| int | max_water_velocity (bool fueled=true) const |
| int | max_rotor_velocity (bool fueled=true) const |
| int | max_velocity (bool fueled=true) const |
| int | max_reverse_velocity (bool fueled=true) const |
| int | safe_ground_velocity (bool fueled=true) const |
| int | safe_rotor_velocity (bool fueled=true) const |
| int | safe_water_velocity (bool fueled=true) const |
| int | safe_velocity (bool fueled=true) const |
| void | spew_field (double joules, int part, field_type_id type, int intensity=1) const |
| void | noise_and_smoke (int load, time_duration time=1_turns) |
| Generate noise or smoke from a vehicle with engines turned on load = how hard the engines are working, from 0.0 until 1.0 time = how many seconds to generated smoke for. More... | |
| int | wheel_area () const |
| Calculates the sum of the area under the wheels of the vehicle. More... | |
| float | average_offroad_rating () const |
| double | coeff_air_drag () const |
| Physical coefficients used for vehicle calculations. More... | |
| double | coeff_rolling_drag () const |
| coefficient of rolling resistance multiplied by velocity to get the variable part of rolling resistance drag in N multiplied by a constant to get the constant part of rolling resistance drag in N depends on wheel design, wheel number, and vehicle weight More... | |
| double | coeff_water_drag () const |
| coefficient of water drag in kg/m multiplied by the square of speed to calculate water drag force in N proportional to cross sectional area of the vehicle, times the density of water, times a dimensional constant based on the vehicle's shape More... | |
| double | water_hull_height () const |
| watertight hull height in meters measures distance from bottom of vehicle to the point where the vehicle will start taking on water More... | |
| double | water_draft () const |
| water draft in meters - how much of the vehicle's body is under water must be less than the hull height or the boat will sink at some point, also add boats with deep draft running around More... | |
| bool | can_float () const |
| can_float does the vehicle have freeboard or does it overflow with water? More... | |
| bool | is_in_water (bool deep_water=false) const |
| is the vehicle mostly in water or mostly on fairly dry land? More... | |
| bool | is_watercraft () const |
| should vehicle be handled using watercraft logic as determined by amount of water it is in (and whether it is amphibious) result being true does not guarantee it is viable boat – check can_float() More... | |
| double | lift_thrust_of_rotorcraft (bool fuelled, bool safe=false) const |
| is the vehicle flying? is it a rotorcraft? More... | |
| bool | has_sufficient_rotorlift () const |
| int | get_z_change () const |
| bool | is_flying_in_air () const |
| void | set_flying (bool new_flying_value) |
| bool | is_rotorcraft () const |
| bool | is_flyable () const |
| void | set_flyable (bool val) |
| bool | would_install_prevent_flyable (const vpart_info &vpinfo, const Character &pc) const |
| bool | would_removal_prevent_flyable (const vehicle_part &vp, const Character &pc) const |
| bool | would_repair_prevent_flyable (const vehicle_part &vp, const Character &pc) const |
| bool | can_control_in_air (const Character &pc) const |
| bool | can_control_on_land (const Character &pc) const |
| float | k_traction (float wheel_traction_area) const |
| Traction coefficient of the vehicle. More... | |
| units::power | static_drag (bool actual=true) const |
| float | strain () const |
| bool | sufficient_wheel_config () const |
| bool | balanced_wheel_config () const |
| bool | valid_wheel_config () const |
| float | steering_effectiveness () const |
| float | handling_difficulty () const |
| Returns roughly driving skill level at which there is no chance of fumbling. More... | |
| void | idle (bool on_map) |
| void | alarm () |
| void | slow_leak () |
| void | thrust (int thd, int z=0) |
| void | smart_controller_handle_turn (const std::optional< float > &k_traction_cache=std::nullopt) |
| if smart controller is enabled, turns on and off engines depending on load and battery level More... | |
| bool | has_available_electric_engine () |
| void | disable_smart_controller_if_needed () |
| int | slowdown (int velocity) const |
| void | possibly_recover_from_skid () |
| float | forward_velocity () const |
| void | cruise_thrust (int amount) |
| void | turn (units::angle deg) |
| bool | collision (std::vector< veh_collision > &colls, const tripoint &dp, bool just_detect, bool bash_floor=false) |
| veh_collision | part_collision (int part, const tripoint &p, bool just_detect, bool bash_floor) |
| void | handle_trap (const tripoint &p, vehicle_part &vp_wheel) |
| void | activate_magical_follow () |
| void | activate_animal_follow () |
| void | selfdrive (const point &) |
| vehicle is driving itself More... | |
| bool | check_heli_descend (Character &p) const |
| can the helicopter descend/ascend here? More... | |
| bool | check_heli_ascend (Character &p) const |
| bool | check_is_heli_landed () |
| void | pldrive (Character &driver, const point &p, int z=0) |
| Player is driving the vehicle. More... | |
| int | prepare_tool (item &tool) const |
Flags item tool with PSEUDO, if it has MOD pocket then a pseudo_magazine_mod is installed and a pseudo_magazine is inserted into the magazine well pocket with however many ammo charges of the first ammo type required by the tool are available to this vehicle. More... | |
| std::pair< const itype_id &, int > | tool_ammo_available (const itype_id &tool_type) const |
if tool is not an itype with tool != nullptr this returns { itype::NULL_ID(), 0 } pair More... | |
| std::map< item, int > | prepare_tools (const vehicle_part &vp) const |
| void | make_active (item_location &loc) |
| Update an item's active status, for example when adding hot or perishable liquid to a container. More... | |
| std::optional< vehicle_stack::iterator > | add_item (vehicle_part &vp, const item &itm) |
| Try to add an item to part's cargo. More... | |
| int | add_charges (vehicle_part &vp, const item &itm) |
| Add an item counted by charges to the part's cargo. More... | |
| bool | remove_item (vehicle_part &vp, item *it) |
| vehicle_stack::iterator | remove_item (vehicle_part &vp, const vehicle_stack::const_iterator &it) |
| vehicle_stack | get_items (const vehicle_part &vp) const |
| vehicle_stack | get_items (vehicle_part &vp) |
| std::vector< item > & | get_tools (vehicle_part &vp) |
| const std::vector< item > & | get_tools (const vehicle_part &vp) const |
| void | place_spawn_items () |
| void | place_zones (map &pmap) const |
| void | gain_moves () |
| bool | decrement_summon_timer () |
| void | stop () |
| void | refresh_insides () |
| void | unboard_all () const |
| int | damage (map &here, int p, int dmg, const damage_type_id &type=damage_type_id("bash"), bool aimed=true) |
| void | damage_all (int dmg1, int dmg2, const damage_type_id &type, const point &impact) |
| void | shift_parts (map &here, const point &delta) |
| Shifts all parts of the vehicle by the given amounts, and then shifts the vehicle itself in the opposite direction. More... | |
| bool | shift_if_needed (map &here) |
| Detect if the vehicle is currently missing a 0,0 part, and adjust if necessary. More... | |
| void | shed_loose_parts (trinary shed_cables=trinary::NONE, const tripoint_bub_ms *dst=nullptr) |
| Drop parts with UNMOUNT_ON_MOVE onto the ground. More... | |
| void | unlink_cables (const point &mount, Character &remover, bool unlink_items=false, bool unlink_tow_cables=false, bool unlink_power_cords=false) |
| Disconnect cables attached to the specified mount point. More... | |
| vehicle_part_with_feature_range< std::string > | get_avail_parts (std::string feature) const |
| Yields a range of parts of this vehicle that each have the given feature and are available: not broken, removed, or part of a carried vehicle. More... | |
| vehicle_part_with_feature_range< vpart_bitflags > | get_avail_parts (vpart_bitflags f) const |
| vehicle_part_with_feature_range< std::string > | get_parts_including_carried (std::string feature) const |
| Yields a range of parts of this vehicle that each have the given feature and are not broken or removed. More... | |
| vehicle_part_with_feature_range< vpart_bitflags > | get_parts_including_carried (vpart_bitflags f) const |
| vehicle_part_with_feature_range< std::string > | get_any_parts (std::string feature) const |
| Yields a range of parts of this vehicle that each have the given feature and not removed. More... | |
| vehicle_part_with_feature_range< vpart_bitflags > | get_any_parts (vpart_bitflags f) const |
| vehicle_part_with_feature_range< std::string > | get_enabled_parts (std::string feature) const |
| Yields a range of parts of this vehicle that each have the given feature and are enabled and available: not broken, removed, or part of a carried vehicle. More... | |
| vehicle_part_with_feature_range< vpart_bitflags > | get_enabled_parts (vpart_bitflags f) const |
Static Public Member Functions | |
| static vehicle * | find_vehicle (const tripoint_abs_ms &where) |
| Find a possibly off-map vehicle. More... | |
| static bool | use_vehicle_tool (vehicle &veh, const tripoint &vp_pos, const itype_id &tool_type, bool no_invoke=false) |
Public Attributes | |
| std::set< point > | collision_check_points |
| units::power | linked_item_epower_this_turn |
Private Member Functions | |
| bool | has_structural_part (const point &dp) const |
| bool | is_structural_part_removed () const |
| Returns whether or not the vehicle has a structural part queued for removal,. More... | |
| void | open_or_close (int part_index, bool opening) |
| Opens or closes an openable part at the specified index based on the @opening value passed. More... | |
| void | lock_or_unlock (int part_index, bool locking) |
| Locks or unlocks a lockable door part at the specified index based on the @locking value passed. More... | |
| bool | is_connected (const vehicle_part &to, const vehicle_part &from, const vehicle_part &excluded) const |
| Performs a breadth-first search from one part to another, to see if a path exists between the two without going through the excluded part. More... | |
| int | damage_direct (map &here, vehicle_part &vp, int dmg, const damage_type_id &type=damage_type_id("pure")) |
| int | break_off (map &here, vehicle_part &vp, int dmg) |
| bool | explode_fuel (vehicle_part &vp, const damage_type_id &type) |
| void | smash_security_system () |
| units::power | part_vpower_w (const vehicle_part &vp, bool at_full_hp=false) const |
| units::power | part_epower (const vehicle_part &vp) const |
| int | power_to_energy_bat (units::power power, const time_duration &d) const |
| bool | do_environmental_effects () const |
| void | print_fuel_indicator (const catacurses::window &w, const point &p, const itype_id &fuel_type, bool verbose=false, bool desc=false) |
| Prints a fuel gauge for a vehicle. More... | |
| void | print_fuel_indicator (const catacurses::window &w, const point &p, const itype_id &fuel_type, std::map< itype_id, units::energy > fuel_usages, bool verbose=false, bool desc=false) |
| time_duration | engine_start_time (const vehicle_part &vp) const |
| double | engine_cold_factor (const vehicle_part &vp) const |
| void | refresh_pivot () const |
| void | calc_mass_center (bool precalc) const |
| void | leak_fuel (vehicle_part &pt) const |
| empty the contents of a tank, battery or turret spilling liquids randomly on the ground More... | |
| vehicle & | operator= (const vehicle &)=default |
Static Private Member Functions | |
| template<typename Vehicle > | |
| static std::map< Vehicle *, float > | search_connected_vehicles (Vehicle *start) |
| Returns a map of connected vehicle pointers to power loss factor: Keys are vehicles connected by POWER_TRANSFER parts, includes self Values are line loss, 0.01 corresponds to 1% charge loss to wire resistance May load the connected vehicles' submaps Templated to support const and non-const vehicle*. More... | |
Vehicle turrets | |
| faction_id | owner = faction_id::NULL_ID() |
| faction_id | old_owner = faction_id::NULL_ID() |
| std::vector< int > | alternators |
| std::vector< int > | engines |
| std::vector< int > | reactors |
| std::vector< int > | solar_panels |
| std::vector< int > | wind_turbines |
| std::vector< int > | water_wheels |
| std::vector< int > | sails |
| std::vector< int > | funnels |
| std::vector< int > | emitters |
| std::vector< int > | loose_parts |
| std::vector< int > | wheelcache |
| std::vector< int > | rotors |
| std::vector< int > | rail_wheelcache |
| std::vector< int > | steering |
| std::vector< int > | speciality |
| std::vector< int > | floating |
| std::vector< int > | batteries |
| std::vector< int > | fuel_containers |
| std::vector< int > | turret_locations |
| std::vector< int > | mufflers |
| std::vector< int > | planters |
| std::vector< int > | accessories |
| std::vector< int > | cable_ports |
| std::vector< int > | fake_parts |
| std::vector< int > | control_req_parts |
| std::string | name |
| vproto_id | type |
| Type of the vehicle as it was spawned. More... | |
| std::map< point, std::vector< int > > | relative_parts |
| std::set< label > | labels |
| std::set< std::string > | tags |
| std::map< itype_id, units::energy > | fuel_remainder |
| std::map< itype_id, units::energy > | fuel_used_last_turn |
| std::unordered_multimap< point, zone_data > | loot_zones |
| active_item_cache | active_items |
| bool | magic = false |
| std::optional< time_duration > | summon_time_limit = std::nullopt |
| std::optional< smart_controller_cache > | smart_controller_state = std::nullopt |
| std::optional< smart_controller_config > | smart_controller_cfg = std::nullopt |
| bool | has_enabled_smart_controller = false |
| tripoint | sm_pos = tripoint_zero |
| Submap coordinates of the currently loaded submap (see game::m) that contains this vehicle. More... | |
| int | alternator_load = 0 |
| time_point | last_update = calendar::before_time_starts |
| point | pos = point_zero |
| Position of the vehicle inside the submap that contains the vehicle. More... | |
| int | velocity = 0 |
| int | avg_velocity = 0 |
| vehicle continuous moving average velocity see https://en.wikipedia.org/wiki/Moving_average#Exponential_moving_average alpha is 0.5: avg_velocity = avg_velocity + 0.5(velocity - avg_velocity) = 0.5 avg_velocity + 0.5 velocity More... | |
| int | cruise_velocity = 0 |
| int | vertical_velocity = 0 |
| int | om_id = 0 |
| units::angle | turn_dir = 0_degrees |
| units::angle | last_turn = 0_degrees |
| float | of_turn = 0.0f |
| float | of_turn_carry = 0.0f |
| units::power | extra_drag = 0_W |
| std::optional< time_point > | theft_time |
| std::array< units::angle, 2 > | pivot_rotation = { { 0_degrees, 0_degrees } } |
| bounding_box | rail_wheel_bounding_box |
| point | front_left |
| point | front_right |
| towing_data | tow_data |
| std::array< point, 2 > | pivot_anchor |
| tileray | face |
| tileray | move |
| bool | is_on_ramp = false |
| bool | is_autodriving = false |
| bool | is_following = false |
| bool | is_patrolling = false |
| bool | all_wheels_on_one_axis = false |
| bool | engine_on = false |
| bool | tracking_on = false |
| bool | is_locked = false |
| bool | is_alarm_on = false |
| bool | camera_on = false |
| bool | autopilot_on = false |
| bool | precollision_on = true |
| bool | skidding = false |
| bool | check_environmental_effects = false |
| bool | insides_dirty = true |
| bool | is_falling = false |
| bool | zones_dirty = true |
| unsigned char | vehicle_noise = 0 |
| double | coefficient_air_resistance = 1 |
| double | coefficient_rolling_resistance = 1 |
| double | coefficient_water_resistance = 1 |
| double | draft_m = 1 |
| double | hull_height = 0.3 |
| tripoint | occupied_cache_pos = { -1, -1, -1 } |
| units::angle | occupied_cache_direction = 0_degrees |
| std::set< tripoint > | occupied_points |
| std::vector< vehicle_part > | parts |
| std::map< point, vpart_edge_info > | edges |
| safe_reference_anchor | anchor |
| units::mass | mass_cache |
| point | pivot_cache |
| point | mount_max |
| point | mount_min |
| point | mass_center_precalc |
| point | mass_center_no_precalc |
| tripoint | autodrive_local_target = tripoint_zero |
| std::shared_ptr< autodrive_controller > | active_autodrive_controller |
| bool | no_refresh = false |
| bool | pivot_dirty = true |
| bool | mass_dirty = true |
| bool | mass_center_precalc_dirty = true |
| bool | mass_center_no_precalc_dirty = true |
| bool | coeff_rolling_dirty = true |
| bool | coeff_air_dirty = true |
| bool | coeff_water_dirty = true |
| bool | coeff_air_changed = true |
| bool | in_deep_water = false |
| bool | in_water = false |
| bool | is_flying = false |
| bool | flyable = true |
| int | requested_z_change = 0 |
| std::vector< vehicle_part * > | find_all_ready_turrets (bool manual, bool automatic) |
| bool | turrets_aim (std::vector< vehicle_part * > &turrets) |
| int | turrets_aim_and_fire (std::vector< vehicle_part * > &turrets) |
| std::vector< std::reference_wrapper< const vehicle_part > > | real_parts () const |
| vpart_edge_info | get_edge_info (const point &mount) const |
| void | remove_fake_parts (bool cleanup=true) |
| bool | should_enable_fake (const tripoint &fake_precalc, const tripoint &parent_precalc, const tripoint &neighbor_precalc) const |
| std::vector< vehicle_part * > | turrets () |
| Get all vehicle turrets (excluding any that are destroyed) More... | |
| std::vector< vehicle_part * > | turrets (const tripoint &target) |
| Get all vehicle turrets loaded and ready to fire at target. More... | |
| turret_data | turret_query (vehicle_part &pt) |
| Get firing data for a turret. More... | |
| turret_data | turret_query (const tripoint &pos) |
| void | turrets_set_targeting () |
| Set targeting mode for specific turrets. More... | |
| void | turrets_set_mode () |
| Set firing mode for specific turrets. More... | |
| void | turrets_aim_and_fire_single () |
| Select a single ready turret, aim it using the aiming UI and fire. More... | |
| bool | turrets_aim_and_fire_all_manual (bool show_msg=false) |
| void | turrets_override_automatic_aim () |
| Set target for automatic turrets using the aiming UI. More... | |
| int | automatic_fire_turret (vehicle_part &pt) |
| bool | assign_seat (vehicle_part &pt, const npc &who) |
| Try to assign a crew member (who must be a player ally) to a specific seat. More... | |
| const std::set< tripoint > & | get_points (bool force_refresh=false, bool no_fake=false) const |
| std::list< item > | use_charges (const vpart_position &vp, const itype_id &type, int &quantity, const std::function< bool(const item &)> &filter, bool in_tools=false) |
| Consumes specified charges (or fewer) from the vehicle part. More... | |
| void | open (int part_index) |
| Opens an openable part at the specified index. More... | |
| void | close (int part_index) |
| Closes an openable part at the specified index. More... | |
| void | lock (int part_index) |
| Locks a lockable, closed part at the specified index. More... | |
| void | unlock (int part_index) |
| Unlocks a lockable, closed part at the specified index. More... | |
| bool | part_has_lock (int part_index) const |
| bool | can_close (int part_index, Character &who) |
| bool | is_foldable () const |
| time_duration | folding_time () const |
| time_duration | unfolding_time () const |
| item | get_folded_item () const |
| bool | restore_folded_parts (const item &it) |
| bool | has_security_working () const |
| void | unlock () |
| void | open_all_at (int p) |
Opens everything that can be opened on the same tile as p More... | |
| void | honk_horn () const |
| void | reload_seeds (const tripoint &pos) |
| void | beeper_sound () const |
| void | play_music () const |
| void | play_chimes () const |
| void | operate_planter () |
| void | autopilot_patrol_check () |
| void | toggle_autopilot () |
| void | enable_patrol () |
| void | toggle_tracking () |
| void | operate_scoop () |
| void | operate_reaper () |
| void | crash_terrain_around () |
| void | transform_terrain () |
| void | control_engines () |
| bool | is_engine_type_on (const vehicle_part &vp, const itype_id &ft) const |
| bool | is_engine_on (const vehicle_part &vp) const |
| bool | is_engine_type (const vehicle_part &vp, const itype_id &ft) const |
| bool | is_engine_type_combustion (const vehicle_part &vp) const |
| bool | is_alternator_on (const vehicle_part &vp) const |
| bool | start_engine (vehicle_part &vp, bool turn_on) |
| bool | has_engine_type (const itype_id &ft, bool enabled) const |
| monster * | get_harnessed_animal () const |
| bool | has_engine_type_not (const itype_id &ft, bool enabled) const |
| std::optional< std::string > | has_engine_conflict (const vpart_info &possible_conflict) const |
| bool | is_perpetual_type (const vehicle_part &vp) const |
| void | do_engine_damage (vehicle_part &vp, int strain) |
| void | control_doors () |
| rl_vec2d | velo_vec () const |
| rl_vec2d | face_vec () const |
| rl_vec2d | move_vec () const |
| rl_vec2d | dir_vec () const |
| void | on_move () |
| vehicle * | act_on_map () |
| void | check_falling_or_floating () |
| void | precalculate_vehicle_turning (units::angle new_turn_dir, bool check_rail_direction, ter_furn_flag ter_flag_to_check, int &wheels_on_rail, int &turning_wheels_that_are_one_axis_counter) const |
| Precalculate vehicle turn. More... | |
| bool | allow_auto_turn_on_rails (units::angle &corrected_turn_dir) const |
| bool | allow_manual_turn_on_rails (units::angle &corrected_turn_dir) const |
| bool | is_wheel_state_correct_to_turn_on_rails (int wheels_on_rail, int wheel_count, int turning_wheels_that_are_one_axis) const |
| void | set_submap_moved (const tripoint &p) |
| Update the submap coordinates and update the tracker info in the overmap (if enabled). More... | |
| void | use_autoclave (int p) |
| void | use_washing_machine (int p) |
| void | use_dishwasher (int p) |
| void | use_monster_capture (int part, const tripoint &pos) |
| void | use_harness (int part, const tripoint &pos) |
| void | build_electronics_menu (veh_menu &menu) |
| void | build_bike_rack_menu (veh_menu &menu, int part) |
| void | build_interact_menu (veh_menu &menu, const tripoint &p, bool with_pickup) |
| void | interact_with (const tripoint &p, bool with_pickup=false) |
| std::string | disp_name () const |
| int | lift_strength () const |
| Required strength to be able to successfully lift the vehicle unaided by equipment. More... | |
| bool | refresh_zones () |
| bounding_box | get_bounding_box (bool use_precalc=true, bool no_fake=false) |
| void | update_time (const time_point &update_to) |
| int | part_count () const |
| int | part_count_real () const |
| int | part_count_real_cached () const |
| vehicle_part & | part (int part_num) |
| const vehicle_part & | part (int part_num) const |
| int | get_non_fake_part (int part_num) const |
| void | update_active_fakes () |
| item | part_to_item (const vehicle_part &vp) const |
| Generate the corresponding item from this vehicle part. More... | |
| item | removed_part (const vehicle_part &vp) const |
| If the vehicle part has an item it is removed as, transform the item to the item it is removed_as. More... | |
| std::set< int > | advance_precalc_mounts (const point &new_pos, const tripoint &src, const tripoint &dp, int ramp_offset, bool adjust_pos, std::set< int > parts_to_move) |
| bool | level_vehicle () |
| void | add_tag (const std::string &tag) |
| bool | has_tag (const std::string &tag) const |
| std::pair< int, double > | get_exhaust_part () const |
| tripoint | exhaust_dest (int part) const |
| std::vector< std::tuple< point, int, std::string > > | get_debug_overlay_data () const |
A vehicle as a whole with all its components.
This object can occupy multiple tiles, the objects actually visible on the map are of type vehicle_part.
Facts you need to know about implementation:
std::vector<vehicle> for each submap in grid. When requesting a reference to vehicle, keep in mind it can be invalidated by functions such as map::displace_vehicle().map::veh_at(), and check vehicle type (veh_null means there's no vehicle there).vpart_info structure that is accessible through vehicle_part::info() method. The second part is variable info, see vehicle_part structure.0, 0 in mount coordinates). There can be more than one part at given mount coordinates, and they are mounted in different slots. Check tileray.h file to see a picture of coordinate axes.precalc[0]. precalc[1] stores mount coordinates for next move (vehicle can move and turn). Method map::displace_vehicle() assigns precalc[1] to precalc[0]. At any time (except map::vehmove() innermost cycle) you can get actual part coordinates relative to vehicle's position by reading precalc[0]. Vehicles rotate around a (possibly changing) pivot point, and the precalculated coordinates always put the pivot point at (0,0).| Direction | Meaning |
|---|---|
| face | where it's facing currently |
| move | where it's moving, it's different from face if it's skidding |
| turn_dir | where it will turn at next move, if it won't stop due to collision |
part or p parameter. This is the index of a part in the parts list.map::board_vehicle() and map::unboard_vehicle() for boarding/unboarding player.orthogonal dir left (-Y)
^
-X -------> +X (forward)
v
orthogonal dir right (+Y)
When adding parts, function checks possibility to install part at given coordinates. If it shows debug messages that it can't add parts, when you start the game, you did something wrong. There are a few rules:
|
explicit |
Definition at line 214 of file vehicle.cpp.
References vehicle_prototype::blueprint, debugmsg, face, tileray::init(), string_id< T >::is_empty(), string_id< T >::is_valid(), move, vehicle_prototype::name, name, refresh(), string_id< T >::str(), translation::translated(), and type.
Referenced by map::add_splatter(), doors::can_lock_door(), doors::can_unlock_door(), doors::close_door(), game::control_vehicle(), map::deregister_vehicle_zone(), unload_loot_activity_actor::do_turn(), optional_vpart_position::extended_description(), advanced_inv_area::init(), doors::lock_door(), map::mop_spills(), monster::move(), open(), pldrive(), advanced_inv_area::set_container_position(), set_item_map_or_vehicle(), map::terrain_moppable(), and doors::unlock_door().
|
delete |
|
default |
| int vehicle::acceleration | ( | bool | fueled = true, |
| int | at_vel_in_vmi = -1 |
||
| ) | const |
Definition at line 3839 of file vehicle.cpp.
References ground_acceleration(), is_flying, is_rotorcraft(), is_watercraft(), rotor_acceleration(), and water_acceleration().
Referenced by current_acceleration().
| vehicle * vehicle::act_on_map | ( | ) |
Definition at line 1813 of file vehicle_move.cpp.
References _, abs(), add_msg(), tileray::advance(), allow_auto_turn_on_rails(), allow_manual_turn_on_rails(), boarded_parts(), can_float(), can_use_rails(), D_INFO, dbg, decrement_summon_timer(), map::destroy_vehicle(), tileray::dir(), tileray::dx(), tileray::dy(), face, floating, g, get_map(), get_passenger(), get_player_character(), global_pos3(), in_deep_water, map::inbounds(), tileray::init(), is_falling, is_flying, is_rotorcraft(), is_watercraft(), k_traction(), m_bad, m_info, move, map::move_vehicle(), mps_to_vmiph(), name, of_turn, of_turn_carry, map::on_vehicle_moved(), one_in(), part_with_feature(), player_in_control(), Character::practice(), requested_z_change, skidding, skill_driving, sm_pos, sqrt(), vehicles::steer_increment, stop(), tile_height, turn(), turn_dir, unboard_all(), map::vehicle_wheel_traction(), velocity, vertical_velocity, vehicles::vmiph_per_tile, vmiph_to_mps(), VPFLAG_CONTROLS, tripoint::x, tripoint::y, and tripoint::z.
Referenced by map::vehproceed().
| void vehicle::activate_animal_follow | ( | ) |
Definition at line 596 of file vehicle.cpp.
References effect_harnessed, vehicle_part::enabled, engine_on, vpart_info::fuel_type, fuel_type_animal, get_monster(), Creature::has_effect(), vehicle_part::info(), is_following, parts, and refresh().
Referenced by assign_veh_to_follow().
| void vehicle::activate_magical_follow | ( | ) |
Definition at line 582 of file vehicle.cpp.
References engine_on, fuel_type_mana, is_following, parts, and refresh().
Referenced by tell_magic_veh_to_follow().
| units::power vehicle::active_reactor_epower | ( | ) | const |
Definition at line 5164 of file vehicle.cpp.
References vehicle_part::ammo_remaining(), connected_battery_power_level(), vehicle_part::enabled, units::from_kilowatt(), vpart_info::has_flag(), vehicle_part::info(), vehicle_part::is_available(), min(), net_battery_charge_rate(), part_epower(), parts, reactors, and STATIC.
Referenced by veh_app_interact::draw_info(), and net_battery_charge_rate().
| int vehicle::add_charges | ( | vehicle_part & | vp, |
| const item & | itm | ||
| ) |
Add an item counted by charges to the part's cargo.
Definition at line 5837 of file vehicle.cpp.
References add_item(), item_stack::amount_can_fit(), item::charges, item::count_by_charges(), debugmsg, get_items(), and cata::hash64_detail::ret.
Referenced by put_into_vehicle().
| std::optional< vehicle_stack::iterator > vehicle::add_item | ( | vehicle_part & | vp, |
| const item & | itm | ||
| ) |
Try to add an item to part's cargo.
Definition at line 5853 of file vehicle.cpp.
References active_items, active_item_cache::add(), item::ammo_type(), item::ammo_types(), item_stack::amount_can_fit(), vehicle_part::base, item::charges, item::count_by_charges(), get_items(), item_stack::get_iterator_from_pointer(), global_part_pos3(), cata::colony< element_type, element_allocator_type, element_skipfield_type >::insert(), invalidate_mass(), item::is_ammo(), vehicle_part::is_broken(), item::is_bucket_nonempty(), item::is_gun(), vehicle_part::items, item::merge_charges(), vehicle_part::mount, item::spill_contents(), and item_stack::stacks_with().
Referenced by add_charges(), unload_loot_activity_actor::do_turn(), vehicle_stack::insert(), move_item(), operate_reaper(), operate_scoop(), place_spawn_items(), put_into_vehicle(), and set_item_map_or_vehicle().
| void vehicle::add_tag | ( | const std::string & | tag | ) |
Definition at line 8317 of file vehicle.cpp.
References tags.
Referenced by merge_appliance_into_grid(), place_appliance(), and split_vehicles().
| std::set< int > vehicle::advance_precalc_mounts | ( | const point & | new_pos, |
| const tripoint & | src, | ||
| const tripoint & | dp, | ||
| int | ramp_offset, | ||
| bool | adjust_pos, | ||
| std::set< int > | parts_to_move | ||
| ) |
Definition at line 8153 of file vehicle.cpp.
References map::clear_vehicle_point_from_cache(), get_map(), map::has_flag(), occupied_cache_pos, parts, pivot_anchor, pivot_rotation, pos, TFLAG_RAMP_DOWN, TFLAG_RAMP_UP, and tripoint::z.
Referenced by map::displace_vehicle().
| void vehicle::alarm | ( | ) |
Definition at line 1167 of file vehicle_use.cpp.
References _, sounds::alarm, global_pos3(), has_security_working(), is_alarm_on, one_in(), random_entry_ref(), rng(), and sounds::sound().
Referenced by idle().
| std::vector< int > vehicle::all_parts_at_location | ( | const std::string & | location | ) | const |
Returns all parts in the vehicle that exist in the given location slot.
If the empty string is passed in, returns all parts with no slot.
| location | The location slot to get parts for. |
Definition at line 3075 of file vehicle.cpp.
References get_all_parts(), location, and parts.
Referenced by map::add_vehicle_to_map(), coeff_air_drag(), coeff_water_drag(), veh_interact::display_veh(), find_and_split_vehicles(), merge_rackable_vehicle(), and sufficient_wheel_config().
| bool vehicle::allow_auto_turn_on_rails | ( | units::angle & | corrected_turn_dir | ) | const |
Definition at line 1757 of file vehicle_move.cpp.
References tileray::dir(), face, get_corrected_turn_dir(), is_wheel_state_correct_to_turn_on_rails(), precalculate_vehicle_turning(), rail_wheelcache, TFLAG_RAIL, and turn_dir.
Referenced by act_on_map().
| bool vehicle::allow_manual_turn_on_rails | ( | units::angle & | corrected_turn_dir | ) | const |
Definition at line 1738 of file vehicle_move.cpp.
References tileray::dir(), face, get_corrected_turn_dir(), is_wheel_state_correct_to_turn_on_rails(), precalculate_vehicle_turning(), rail_wheelcache, TFLAG_RAIL, and turn_dir.
Referenced by act_on_map().
| bool vehicle::assign_seat | ( | vehicle_part & | pt, |
| const npc & | who | ||
| ) |
Try to assign a crew member (who must be a player ally) to a specific seat.
Definition at line 693 of file vehicle_part.cpp.
References Character::getID(), vehicle_part::is_seat(), parts, and vehicle_part::set_crew().
Referenced by veh_interact::do_assign_crew().
| bool vehicle::auto_select_fuel | ( | vehicle_part & | vp | ) |
Definition at line 611 of file vehicle_use.cpp.
References engine_fuel_left(), vpart_info::engine_info, fuel_left(), vehicle_part::fuel_set(), vpart_info::fuel_type, fuel_type_none, vehicle_part::info(), vehicle_part::is_available(), and vehicle_part::is_engine().
Referenced by init_state(), and start_engine().
| int vehicle::automatic_fire_turret | ( | vehicle_part & | pt | ) |
Definition at line 573 of file turret.cpp.
References _, add_msg(), add_msg_if_player_sees(), Creature::auto_find_hostile_target(), debugmsg, Character::get_name(), get_player_character(), vehicle_part::get_targeting_npc(), global_part_pos3(), gun, Character::is_deaf(), m_warning, max_aoe_size(), min(), n_gettext, vehicle_part::name(), name, pgettext, Creature::pos(), pos, turret_data::ready, vehicle_part::reset_target(), Character::sees(), string_format(), vehicle_part::target, and turret_query().
Referenced by gain_moves().
| void vehicle::autopilot_patrol | ( | ) |
choose one single zone ( multiple zones too complex for now ) choose a point at the far edge of the zone the edge chosen is the edge that is smaller, therefore the longer side of the rectangle is the one the vehicle drives mostly parallel too. if its perfect square then choose a point that is on any edge that the vehicle is not currently at drive to that point. then once arrived, choose a random opposite point of the zone. this should ( in a simple fashion ) cause a patrolling behavior in a criss-cross fashion. in an auto-tractor, this would eventually cover the entire rectangle.
Definition at line 614 of file vehicle.cpp.
References autodrive_local_target, drive_to_local_target(), zone_manager::get_manager(), get_map(), zone_manager::get_near(), map::getlocal(), global_square_location(), map::inbounds(), is_patrolling, max(), min(), coords::coord_point_mut< Point, Subpoint, InBounds >::raw(), rl_dist(), rng(), tripoint_zero, and zone_type_VEHICLE_PATROL.
Referenced by map::vehmove().
| void vehicle::autopilot_patrol_check | ( | ) |
Definition at line 485 of file vehicle_use.cpp.
References enable_patrol(), g, zone_manager::get_manager(), global_square_location(), zone_manager::has_near(), and zone_type_VEHICLE_PATROL.
Referenced by toggle_autopilot().
| int vehicle::avail_linkable_part | ( | const point & | pt, |
| bool | to_ports | ||
| ) | const |
Returns index of part at mount point pt which has link connection and is_available(), or -1 if no such part or it's not is_available()
| pt | only returns parts from this mount point |
| to_ports | if true, look for part with CABLE_PORTS flag. If false, BATTERY. Either way, will also look for APPLIANCE |
Definition at line 2814 of file vehicle.cpp.
References vpart_info::has_flag(), vehicle_part::info(), vehicle_part::is_broken(), part(), and parts_at_relative().
Referenced by item::link_to().
| int vehicle::avail_part_with_feature | ( | const point & | pt, |
| const std::string & | f | ||
| ) | const |
Returns index of part at mount point pt which has given f flag and is_available(), or -1 if no such part or it's not is_available()
| pt | only returns parts from this mount point |
| f | required flag in part's vpart_info flags collection |
| unbroken | if true also requires the part to be !is_broken |
Definition at line 2805 of file vehicle.cpp.
References part(), and part_with_feature().
Referenced by vpart_position::avail_part_with_feature(), game::control_vehicle(), and fuel_left().
| int vehicle::avail_part_with_feature | ( | int | p, |
| vpart_bitflags | f | ||
| ) | const |
Returns p or part index at mount point pt which has given f flag and is_available(), or -1 if no such part or it's not is_available()
| p | index of part to start searching from |
| f | required flag in part's vpart_info flags collection |
| unbroken | if true also requires the part to be !is_broken() |
Definition at line 2796 of file vehicle.cpp.
References part(), and part_with_feature().
| float vehicle::average_offroad_rating | ( | ) | const |
Definition at line 4115 of file vehicle.cpp.
References vehicle_part::info(), part(), vpart_info::wheel_info, and wheelcache.
Referenced by veh_interact::display_stats(), and overmap_ui::get_overmap_path_to().
| void vehicle::backfire | ( | const vehicle_part & | vp | ) | const |
Definition at line 1064 of file vehicle.cpp.
References _, global_part_pos3(), sounds::movement, vehicle_part::name(), part_vpower_w(), pos, sounds::sound(), string_format(), and units::to_watt().
Referenced by noise_and_smoke(), and start_engine().
| bool vehicle::balanced_wheel_config | ( | ) | const |
Definition at line 4745 of file vehicle.cpp.
References inclusive_rectangle< Point, >::contains(), local_center_of_mass(), max(), min(), parts, point_max, point_min, wheelcache, point::x, and point::y.
Referenced by valid_wheel_config(), and wheel_state_description().
| units::power vehicle::basic_consumption | ( | const itype_id & | ftype | ) | const |
Definition at line 3664 of file vehicle.cpp.
References vehicle_part::ammo_current(), engines, fuel_type_battery, vehicle_part::has_fault_flag(), is_engine_type_on(), is_perpetual_type(), part_epower(), part_vpower_w(), and parts.
| int64_t vehicle::battery_left | ( | bool | apply_loss = true | ) | const |
| apply_loss | if true apply wire loss when charge crosses vehicle power cables |
Definition at line 5507 of file vehicle.cpp.
References vehicle_part::ammo_remaining(), batteries, parts, cata::hash64_detail::ret, and search_connected_vehicles().
Referenced by power_parts(), and tool_ammo_available().
| std::pair< int, int > vehicle::battery_power_level | ( | ) | const |
Definition at line 5010 of file vehicle.cpp.
References ammo_battery, b, batteries, and parts.
Referenced by veh_app_interact::draw_info(), and smart_controller_handle_turn().
| void vehicle::beeper_sound | ( | ) | const |
Definition at line 917 of file vehicle_use.cpp.
References _, sounds::alarm, fuel_left(), fuel_type_battery, get_avail_parts(), calendar::once_every(), sounds::sound(), VPFLAG_EVENTURN, and VPFLAG_ODDTURN.
Referenced by gain_moves().
| std::vector< int > vehicle::boarded_parts | ( | ) | const |
Definition at line 3362 of file vehicle.cpp.
References get_avail_parts(), passenger_flag, and VPFLAG_BOARDABLE.
Referenced by act_on_map(), is_passenger(), and unboard_all().
|
private |
Definition at line 7311 of file vehicle.cpp.
References _, map::add_item_or_charges(), add_msg_if_player_sees(), vpart_info::durability, find_and_split_vehicles(), g, json_flag::get(), vpart_info::get_flags(), get_map(), global_part_pos3(), vpart_info::has_flag(), index_of_part(), vehicle_part::info(), invalidate_towing(), vehicle_part::is_broken(), vpart_info::location, m_bad, magic, vehicle_part::mount, vehicle_part::name(), name, part(), part_location_structure(), part_to_item(), parts, parts_at_relative(), map::points_in_radius(), pos, random_entry(), remove, remove_part(), remove_remote_part(), json_flag::requires_flag(), rng(), SCATTER_DISTANCE, and VPFLAG_POWER_TRANSFER.
Referenced by damage_direct().
| tripoint_bub_ms vehicle::bub_part_pos | ( | const vehicle_part & | pt | ) | const |
Definition at line 3457 of file vehicle.cpp.
References pos_bub(), and vehicle_part::precalc.
| tripoint_bub_ms vehicle::bub_part_pos | ( | int | index | ) | const |
Definition at line 3452 of file vehicle.cpp.
References parts.
Referenced by bikerack_racking_activity_actor::bikerack_racking_activity_actor(), bikerack_unracking_activity_actor::bikerack_unracking_activity_actor(), decrement_summon_timer(), shed_loose_parts(), start_engines(), and vehicle_folding_activity_actor::vehicle_folding_activity_actor().
| void vehicle::build_bike_rack_menu | ( | veh_menu & | menu, |
| int | part | ||
| ) |
Definition at line 1639 of file vehicle_use.cpp.
References _, veh_menu::add(), Character::assign_activity(), veh_menu_item::desc(), veh_menu::desc_lines_hint, veh_menu_item::enable(), find_vehicles_to_rack(), find_vehicles_to_unrack(), get_any_parts(), get_player_character(), veh_menu_item::hotkey_auto(), max(), name, veh_menu_item::on_submit(), part(), veh_menu_item::skip_locked_check(), and string_format().
| void vehicle::build_electronics_menu | ( | veh_menu & | menu | ) |
Definition at line 285 of file vehicle_use.cpp.
References _, action, veh_menu::add(), add_electronic_toggle(), add_msg(), c_pink, camera_on, colorize(), control_doors(), veh_menu_item::enable(), fuel_left(), fuel_type_battery, get_any_parts(), get_avatar(), has_part(), veh_menu_item::hotkey(), veh_menu_item::keep_menu_open(), name, veh_menu_item::on_submit(), pgettext, iuse::portable_game(), and tripoint_zero.
Referenced by build_interact_menu().
Definition at line 1822 of file vehicle_use.cpp.
References _, veh_menu::add(), add_msg(), Character::add_msg_if_player(), Character::add_or_drop_with_msg(), Character::assign_activity(), vpart_position::avail_part_with_feature(), turret_data::base(), build_electronics_menu(), turret_data::can_reload(), turret_data::can_unload(), smart_controller_ui::control(), control_engines(), Character::controlling_vehicle, coord_translate(), Character::crafting_inventory(), debugmsg, veh_menu_item::desc(), disable_smart_controller_if_needed(), smart_controller_settings::enabled, engine_on, engines, fuel_type_muscle, g, get_avail_parts(), get_map(), get_non_fake_part(), get_parts_at(), get_player_character(), vpart_info::get_pseudo_tools(), vpart_position::get_tools(), global_square_location(), handbrake(), has_enabled_smart_controller, has_engine_type_not(), has_part(), inventory::has_quality(), has_security_working(), honk_horn(), veh_menu_item::hotkey(), invalidate_mass(), is_alarm_on, is_appliance(), is_locked, is_moving(), veh_menu_item::keep_menu_open(), linked_flag, max(), vpart_position::mount(), turret_data::name(), veh_menu_item::on_submit(), vpart_position::part_index(), parts, Character::pause(), pos, vpart_position::pos(), qual_SCREW, coords::coord_point_mut< Point, Subpoint, InBounds >::raw(), point::rotate(), Character::select_ammo(), skill_mechanics, veh_menu_item::skip_locked_check(), veh_menu_item::skip_theft_check(), smart_controller_cfg, smash_security_system(), start_engines(), stop_engines(), string_format(), tripoint::to_string(), toggle_autopilot(), toggle_tracking(), vpart_info::toolkit_info, tracking_on, turret_query(), turrets_aim_and_fire_all_manual(), turrets_aim_and_fire_single(), turrets_override_automatic_aim(), turrets_set_mode(), turrets_set_targeting(), unlink_cables(), Character::unload(), map::veh_at(), VPFLAG_POWER_TRANSFER, and working.
Referenced by interact_with(), and veh_app_interact::populate_app_actions().
|
private |
Definition at line 7997 of file vehicle.cpp.
References get_all_parts(), get_items(), get_monster(), get_passenger(), get_tools(), Character::get_weight(), monster::get_weight(), mass_cache, mass_center_no_precalc, mass_center_no_precalc_dirty, mass_center_precalc, mass_center_precalc_dirty, mass_dirty, vpart_position::mount(), vpart_position::part_index(), round(), VPFLAG_BOARDABLE, point::x, and point::y.
Referenced by local_center_of_mass(), rotated_center_of_mass(), and total_mass().
| bool vehicle::can_close | ( | int | part_index, |
| Character & | who | ||
| ) |
Definition at line 1252 of file vehicle_use.cpp.
References _, Character::add_msg_if_player(), creature_tracker::creature_at(), Creature::disp_name(), find_lines_of_parts(), get_creature_tracker(), Creature::get_name(), get_non_fake_part(), global_part_pos3(), Creature::is_avatar(), Creature::is_monster(), m_info, and parts.
Referenced by doors::close_door(), and control_doors().
| bool vehicle::can_control_in_air | ( | const Character & | pc | ) | const |
Definition at line 4467 of file vehicle.cpp.
References control_req_parts, Character::get_skill_level(), Character::has_proficiency(), and parts.
Referenced by pldrive().
| bool vehicle::can_control_on_land | ( | const Character & | pc | ) | const |
Definition at line 4484 of file vehicle.cpp.
References control_req_parts, Character::get_skill_level(), Character::has_proficiency(), and parts.
Referenced by pldrive().
| bool vehicle::can_enable | ( | const vehicle_part & | pt, |
| bool | alert = false |
||
| ) | const |
Test if part can be enabled (unbroken, sufficient fuel etc), optionally displaying failures to user.
Definition at line 662 of file vehicle_part.cpp.
References _, add_msg(), debugmsg, vpart_info::epower, fuel_left(), fuel_type_battery, get_player_character(), vpart_info::has_flag(), vehicle_part::info(), vehicle_part::is_broken(), m_bad, vehicle_part::name(), parts, pos, vehicle_part::removed, and warm_enough_to_plant().
| bool vehicle::can_float | ( | ) | const |
can_float does the vehicle have freeboard or does it overflow with water?
Definition at line 4349 of file vehicle.cpp.
References coeff_water_dirty, coeff_water_drag(), draft_m, and hull_height.
Referenced by act_on_map(), overmap_ui::get_overmap_path_to(), k_traction(), map::move_vehicle(), on_move(), game::place_vehicle_nearby(), slowdown(), steering_effectiveness(), thrust(), vehicle_unfolding_activity_actor::unfold_vehicle(), map::vehicle_wheel_traction(), wait(), and wheel_state_description().
| ret_val< void > vehicle::can_mount | ( | const point & | dp, |
| const vpart_info & | vpi | ||
| ) | const |
| dp | The coordinate to mount at (in vehicle mount point coords) |
| vpi | The part type to check |
Definition at line 1181 of file vehicle.cpp.
References _, enumerate_as_string(), json_flag::get(), vehicles::parts::get_all(), vpart_info::get_flags(), has_engine_conflict(), vpart_info::has_flag(), has_structural_part(), vpart_info::id, vehicle_part::info(), is_structural_part_removed(), vpart_info::location, ret_val< T >::make_failure(), ret_val< T >::make_success(), vpart_info::name(), or_, part(), part_location_structure(), parts, parts_at_relative(), point_east, point_north, point_south, point_west, json_flag::requires_flag(), string_replace(), VPFLAG_CARGO, VPFLAG_OPAQUE, and VPFLAG_POWER_TRANSFER.
Referenced by map::add_vehicle_to_map(), install_part(), item::link_to(), vehicle_prototype::save_vehicle_as_prototype(), and veh_interact::update_part_requirements().
| ret_val< void > vehicle::can_unmount | ( | const vehicle_part & | vp_to_remove, |
| bool | allow_splits = false |
||
| ) | const |
Definition at line 1296 of file vehicle.cpp.
References _, animal_flag, carried_flag, carrying_flag, four_adjacent_offsets, json_flag::get(), vpart_info::get_flags(), vpart_info::has_flag(), vehicle_part::has_flag(), index_of_part(), vehicle_part::info(), is_connected(), vpart_info::location, ret_val< T >::make_failure(), ret_val< T >::make_success(), vehicle_part::mount, vehicle_part::name(), next_part_to_unlock(), part_location_structure(), parts, parts_at_relative(), json_flag::requires_flag(), and VPFLAG_POWER_TRANSFER.
Referenced by veh_interact::can_remove_part(), veh_interact::cant_do(), and veh_app_interact::populate_app_actions().
| bool vehicle::can_use_rails | ( | ) | const |
Definition at line 3733 of file vehicle.cpp.
References get_map(), global_part_pos3(), map::has_flag_ter_or_furn(), rail_wheelcache, TFLAG_RAIL, and wheelcache.
Referenced by act_on_map(), on_move(), and wait().
| int vehicle::charge_battery | ( | int | amount, |
| bool | apply_loss = true |
||
| ) |
Charges batteries in connected vehicles/appliances.
| amount | to charge in kJ |
| apply_loss | if true apply wire loss when charge crosses vehicle power cables |
Definition at line 5521 of file vehicle.cpp.
References add_msg_debug, ammo_battery, vehicle_part::ammo_capacity(), vehicle_part::ammo_remaining(), batteries, debugmsg, debugmode::DF_VEHICLE, distribute_charge_evenly(), roll_remainder(), search_connected_batteries(), and weighted_power_loss().
Referenced by item::charge_linked_batteries(), power_parts(), spell_effect::recharge_vehicle(), update_time(), and debug_menu::vehicle_battery_charge().
| void vehicle::check_falling_or_floating | ( | ) |
Definition at line 2042 of file vehicle_move.cpp.
References below, get_map(), get_points(), global_part_pos3(), map::has_flag(), map::has_flag_ter_or_furn(), in_deep_water, in_water, is_falling, is_flying, is_rotorcraft(), OVERMAP_DEPTH, map::supports_above(), TFLAG_DEEP_WATER, TFLAG_NO_FLOOR, TFLAG_SWIMMABLE, wheelcache, tripoint::xy(), and tripoint::z.
Referenced by gain_moves(), game::grabbed_veh_move(), and map::move_vehicle().
| bool vehicle::check_heli_ascend | ( | Character & | p | ) | const |
Definition at line 1385 of file vehicle_move.cpp.
References _, above, Character::add_msg_if_player(), creature_tracker::creature_at(), debugmsg, get_creature_tracker(), get_map(), get_points(), map::has_flag_ter_or_furn(), map::impassable_ter_furn(), is_flying_in_air(), is_rotorcraft(), m_bad, OVERMAP_HEIGHT, sm_pos, TFLAG_INDOORS, map::veh_at(), velocity, and tripoint::z.
Referenced by pldrive().
| bool vehicle::check_heli_descend | ( | Character & | p | ) | const |
can the helicopter descend/ascend here?
Definition at line 1350 of file vehicle_move.cpp.
References _, Character::add_msg_if_player(), below, creature_tracker::creature_at(), debugmsg, get_creature_tracker(), get_map(), get_points(), map::has_flag_ter_or_furn(), map::impassable_ter_furn(), is_rotorcraft(), m_bad, OVERMAP_DEPTH, TFLAG_NO_FLOOR, map::veh_at(), and velocity.
Referenced by pldrive().
| bool vehicle::check_is_heli_landed | ( | ) |
Definition at line 1338 of file vehicle_move.cpp.
References get_map(), global_pos3(), is_flying, and TFLAG_NO_FLOOR.
Referenced by map::displace_vehicle().
| void vehicle::close | ( | int | part_index | ) |
Closes an openable part at the specified index.
If it's a multipart, closes all attached parts as well.
| part_index | The index in the parts list of the part to close. |
Definition at line 1210 of file vehicle_use.cpp.
References debugmsg, vpart_info::has_flag(), vehicle_part::info(), vehicle_part::name(), name, open_or_close(), part(), and VPFLAG_OPENABLE.
Referenced by doors::close_door().
| double vehicle::coeff_air_drag | ( | ) | const |
Physical coefficients used for vehicle calculations.
coefficient of air drag in kg/m multiplied by the square of speed to calculate air drag force in N proportional to cross sectional area of the vehicle, times the density of air, times a dimensional constant based on the vehicle's shape
Definition at line 4159 of file vehicle.cpp.
References add_msg_debug, all_parts_at_location(), coeff_air_dirty, coefficient_air_resistance, debugmode::DF_VEHICLE_DRAG, vpart_info::has_flag(), vehicle_part::info(), vehicle_part::is_available(), last, length, vpart_info::location, max(), maxrow, min(), minrow, mount_max, mount_min, name, part_location_center(), part_location_onroof(), part_location_structure(), parts, parts_at_relative(), tile_to_width(), point::x, and point::y.
Referenced by veh_interact::display_stats(), max_ground_velocity(), max_rotor_velocity(), max_water_velocity(), safe_ground_velocity(), safe_rotor_velocity(), safe_water_velocity(), and slowdown().
| double vehicle::coeff_rolling_drag | ( | ) | const |
coefficient of rolling resistance multiplied by velocity to get the variable part of rolling resistance drag in N multiplied by a constant to get the constant part of rolling resistance drag in N depends on wheel design, wheel number, and vehicle weight
Definition at line 4303 of file vehicle.cpp.
References accel_g, coeff_rolling_dirty, coefficient_rolling_resistance, parts, units::to_kilogram(), total_mass(), and wheelcache.
Referenced by veh_interact::display_stats(), max_ground_velocity(), safe_ground_velocity(), and slowdown().
| double vehicle::coeff_water_drag | ( | ) | const |
coefficient of water drag in kg/m multiplied by the square of speed to calculate water drag force in N proportional to cross sectional area of the vehicle, times the density of water, times a dimensional constant based on the vehicle's shape
Definition at line 4501 of file vehicle.cpp.
References all_parts_at_location(), carried_flag, coeff_water_dirty, coefficient_water_resistance, draft_m, floating, vpart_info::has_flag(), vehicle_part::has_flag(), hull_height, vehicle_part::info(), max(), mount_max, mount_min, part(), part_location_structure(), tile_to_width(), units::to_kilogram(), total_mass(), and point::y.
Referenced by can_float(), veh_interact::display_stats(), max_water_velocity(), safe_water_velocity(), slowdown(), water_draft(), and water_hull_height().
| bool vehicle::collision | ( | std::vector< veh_collision > & | colls, |
| const tripoint & | dp, | ||
| bool | just_detect, | ||
| bool | bash_floor = false |
||
| ) |
Definition at line 697 of file vehicle_move.cpp.
References add_msg_debug, debugmode::DF_VEHICLE_MOVE, get_map(), global_pos3(), vpart_info::has_flag(), vehicle_part::info(), vehicle_part::is_fake, is_falling, vehicle_part::is_real_or_active_fake(), is_rotorcraft(), vpart_info::location, max(), min(), name, part_collision(), part_count(), part_location_structure(), parts, map::points_in_radius(), vehicle_part::precalc, vehicle_part::removed, vpart_info::rotor_info, round(), sgn(), tripoint, tripoint_zero, veh_collision::type, veh_coll_nothing, veh_coll_other, velocity, vertical_velocity, VPFLAG_ROTOR, tripoint::x, tripoint::xy(), tripoint::y, and tripoint::z.
Referenced by game::grabbed_veh_move(), and map::move_vehicle().
Definition at line 556 of file vehicle_use.cpp.
References debugmsg, get_map(), item::link_to(), ret_val_common::success(), item::tname(), map::veh_at(), and vehicle_port.
Referenced by place_appliance().
| std::pair< int, int > vehicle::connected_battery_power_level | ( | ) | const |
Definition at line 5026 of file vehicle.cpp.
References search_connected_vehicles().
Referenced by active_reactor_epower(), item::ammo_capacity(), item::ammo_remaining(), item::charge_linked_batteries(), and power_parts().
| void vehicle::consume_fuel | ( | int | load, |
| bool | idling | ||
| ) |
Definition at line 4864 of file vehicle.cpp.
References ACTIVE_EXERCISE, add_msg_debug, bio_jointservo, cruise_velocity, debugmode::DF_VEHICLE, drain_energy(), effect_winded, units::from_kilojoule(), item::fuel_energy(), fuel_left(), fuel_remainder, fuel_type_battery, fuel_type_muscle, fuel_usage(), fuel_used_last_turn, Character::get_bionic_fueled_with_muscle(), Character::get_cardio_acc_base(), Character::get_cardiofit(), get_player_character(), Character::has_active_bionic(), Creature::has_effect(), in_deep_water, ammo_effects::load(), max(), Character::mod_power_level(), Character::mod_stamina(), practice_athletic_proficiency(), practice_pilot_proficiencies(), Character::set_activity_level(), stop(), strain(), and velocity.
| int vehicle::consumption_per_hour | ( | const itype_id & | ftype, |
| units::energy | fuel_per_s | ||
| ) | const |
Definition at line 3684 of file vehicle.cpp.
References fuel_data::energy, engine_on, flag_PERPETUAL, item::get_base_material(), material_type::get_fuel_data(), item::has_flag(), and item.
Referenced by print_fuel_indicator().
| void vehicle::control_doors | ( | ) |
Definition at line 136 of file vehicle_use.cpp.
References _, veh_menu::add(), can_close(), debugmsg, get_avail_parts(), veh_menu::get_items_size(), get_player_character(), global_part_pos3(), vpart_info::has_flag(), veh_menu_item::hotkey_auto(), vehicle_part::info(), veh_menu_item::keep_menu_open(), veh_menu_item::location(), lock(), lock_or_unlock(), vehicle_part::locked, vehicle_part::name(), next_part_to_close(), next_part_to_lock(), next_part_to_open(), next_part_to_unlock(), veh_menu_item::on_submit(), vehicle_part::open, open(), open_or_close(), part(), Creature::pos(), pos, veh_menu::query(), veh_menu::reset(), and string_format().
Referenced by build_electronics_menu().
| void vehicle::control_engines | ( | ) |
Definition at line 380 of file vehicle_use.cpp.
References _, veh_menu::add(), add_msg(), cruise_velocity, veh_menu_item::enable(), vehicle_part::enabled, vpart_info::engine_info, engine_on, engines, vehicle_part::fuel_current(), fuel_left(), get_player_character(), vehicle_part::info(), vehicle_part::is_available(), is_perpetual_type(), veh_menu_item::keep_menu_open(), vehicle_part::name(), name, veh_menu_item::on_submit(), parts, veh_menu::query(), veh_menu::reset(), safe_velocity(), start_engines(), string_format(), and velocity.
Referenced by build_interact_menu().
Definition at line 3301 of file vehicle.cpp.
References pivot_anchor, pivot_rotation, and tripoint::xy().
Referenced by build_interact_menu(), veh_interact::complete_vehicle(), veh_interact::display_veh(), exhaust_dest(), immediate_path(), item::link_to(), link_up_actor::link_to_veh_app(), mount_to_tripoint(), veh_interact::move_cursor(), pivot_displacement(), veh_app_interact::plug(), veh_app_interact::populate_app_actions(), precalc_mounts(), precalculate_vehicle_turning(), item::process_link(), veh_app_interact::refill(), veh_app_interact::remove(), item::reset_link(), veh_interact::serialize_activity(), and slow_leak().
| void vehicle::coord_translate | ( | const units::angle & | dir, |
| const point & | pivot, | ||
| const point & | p, | ||
| tripoint & | q | ||
| ) | const |
Definition at line 3308 of file vehicle.cpp.
References tileray::advance(), tileray::dx(), tileray::dy(), tileray::ortho_dx(), tileray::ortho_dy(), point::x, tripoint::x, point::y, and tripoint::y.
| void vehicle::coord_translate | ( | tileray | tdir, |
| const point & | pivot, | ||
| const point & | p, | ||
| tripoint & | q | ||
| ) | const |
Definition at line 3317 of file vehicle.cpp.
References tileray::advance(), tileray::clear_advance(), tileray::dx(), tileray::dy(), tileray::ortho_dx(), tileray::ortho_dy(), point::x, tripoint::x, point::y, and tripoint::y.
| void vehicle::crash_terrain_around | ( | ) |
Definition at line 957 of file vehicle_use.cpp.
References _, sounds::combat, cruise_velocity, map::destroy(), eight_horizontal_neighbors, get_all_parts(), get_enabled_parts(), get_map(), map::has_flag(), OVERMAP_LAYERS, vpslot_terrain_transform::pre_flags, sounds::sound(), total_power(), velocity, and tripoint::z.
Referenced by idle().
| void vehicle::cruise_thrust | ( | int | amount | ) |
Definition at line 629 of file vehicle_move.cpp.
References abs(), autopilot_on, cruise_velocity, max_reverse_velocity(), max_velocity(), and safe_velocity().
Referenced by pldrive(), and selfdrive().
| int vehicle::current_acceleration | ( | bool | fueled = true | ) | const |
Definition at line 3849 of file vehicle.cpp.
References abs(), acceleration(), and velocity.
Referenced by smart_controller_handle_turn(), and thrust().
| int vehicle::damage | ( | map & | here, |
| int | p, | ||
| int | dmg, | ||
| const damage_type_id & | type = damage_type_id( "bash" ), |
||
| bool | aimed = true |
||
| ) |
Definition at line 7143 of file vehicle.cpp.
References damage_direct(), vpart_info::damage_reduction, vpart_info::durability, get_non_fake_part(), vpart_info::has_flag(), vehicle_part::info(), vpart_info::location, vehicle_part::mount, vehicle_part::open, part(), part_with_feature(), parts, parts_at_relative(), random_entry(), type, and VPFLAG_ROTOR.
Referenced by map::move_vehicle(), operate_planter(), transform_terrain(), and map::vehicle_vehicle_collision().
| void vehicle::damage_all | ( | int | dmg1, |
| int | dmg2, | ||
| const damage_type_id & | type, | ||
| const point & | impact | ||
| ) |
Definition at line 7217 of file vehicle.cpp.
References vpart_info::bonus, damage_direct(), get_all_parts(), get_map(), vpart_info::has_flag(), vehicle_part::info(), vpart_info::location, max(), vehicle_part::mount, part(), part_location_structure(), part_with_feature(), rng(), square_dist(), cata::swap(), and type.
Referenced by map::move_vehicle(), and map::vehicle_vehicle_collision().
|
private |
Definition at line 7457 of file vehicle.cpp.
References _, map::add_item_or_charges(), add_msg_if_player_sees(), vpart_info::base_item, break_off(), cata::colony< element_type, element_allocator_type, element_skipfield_type >::clear(), coeff_air_changed, damage_heat, itype::damage_max(), damage_pure, vpart_info::damage_reduction, vpart_info::durability, effect_harnessed, explode_fuel(), g, get_map(), get_monster(), global_part_pos3(), Creature::has_effect(), vpart_info::has_flag(), vehicle_part::hp(), index_of_part(), vehicle_part::info(), insides_dirty, invalidate_mass(), invalidate_towing(), is_autodriving, vehicle_part::is_broken(), is_flyable(), vehicle_part::is_fuel_store(), vehicle_part::items, leak_fuel(), m_bad, magic, max(), map::memory_cache_dec_set_dirty(), min(), mod_hp(), vehicle_part::name(), name, string_id< T >::obj(), part_to_item(), pivot_dirty, refresh(), Creature::remove_effect(), remove_part(), remove_remote_part(), vehicle_part::removed, rotors, item::set_damage(), set_flyable(), stop_autodriving(), type, VPFLAG_POWER_TRANSFER, and VPFLAG_SIMPLE_PART.
Referenced by damage(), damage_all(), do_engine_damage(), handle_trap(), smash_security_system(), and thrust().
| bool vehicle::decrement_summon_timer | ( | ) |
Definition at line 6111 of file vehicle.cpp.
References _, map::add_item_or_charges(), add_msg_if_player_sees(), bub_part_pos(), cata::colony< element_type, element_allocator_type, element_skipfield_type >::clear(), map::destroy_vehicle(), get_all_parts(), get_map(), global_pos3(), vehicle_part::items, m_info, name, pos, and summon_time_limit.
Referenced by act_on_map().
| void vehicle::deserialize | ( | const JsonObject & | data | ) |
Definition at line 3359 of file savegame_json.cpp.
References item_pocket::data, faction_id, units::from_degrees(), move, om_direction::name(), math_opers::pos(), catacurses::refresh(), anonymous_namespace{item_tname.cpp}::tags(), and type.
| void vehicle::deserialize_parts | ( | const JsonArray & | data | ) |
Definition at line 3466 of file savegame_json.cpp.
References item_pocket::data, and debugmsg.
Referenced by restore_folded_parts().
| rl_vec2d vehicle::dir_vec | ( | ) | const |
Definition at line 1618 of file vehicle_move.cpp.
References angle_to_vec(), and turn_dir.
Referenced by game::get_veh_dir_indicator_location(), handling_difficulty(), and MapExtras::mx_helicopter().
| void vehicle::disable_smart_controller_if_needed | ( | ) |
Definition at line 5796 of file vehicle.cpp.
References _, add_msg(), debugmsg, get_avail_parts(), has_available_electric_engine(), has_enabled_smart_controller, and query_yn().
Referenced by build_interact_menu().
| int vehicle::discharge_battery | ( | int | amount, |
| bool | apply_loss = true |
||
| ) |
Discharges batteries in connected vehicles/appliances.
| amount | to discharge in kJ |
| apply_loss | if true apply wire loss when charge crosses vehicle power cables |
amount in kJ Definition at line 5564 of file vehicle.cpp.
References add_msg_debug, ammo_battery, vehicle_part::ammo_capacity(), vehicle_part::ammo_remaining(), batteries, debugmsg, debugmode::DF_VEHICLE, distribute_charge_evenly(), roll_remainder(), search_connected_batteries(), and weighted_power_loss().
Referenced by item::ammo_consume(), Character::burn_fuel(), item::charge_linked_batteries(), drain(), power_parts(), process_vehicle_items(), spell_effect::recharge_vehicle(), start_engine(), update_time(), use_vehicle_tool(), and debug_menu::vehicle_battery_charge().
| std::string vehicle::disp_name | ( | ) | const |
Definition at line 32 of file vehicle_display.cpp.
References _, name, and string_format().
Referenced by do_towing_move(), enumerate_objects_around_point(), liquid_handler::get_liquid_target(), get_non_fake_part(), get_owner_name(), game::grabbed_veh_move(), item::link_to(), map::move_vehicle(), no_towing_slack(), item::process_link(), monster::shove_vehicle(), tow_cable_too_far(), use_harness(), and map::vehicle_vehicle_collision().
| autodrive_result vehicle::do_autodrive | ( | Character & | driver | ) |
Definition at line 1347 of file vehicle_autodrive.cpp.
References _, abort, abs(), active_autodrive_controller, Character::add_msg_if_player(), close_obstacle, cruise_velocity, debugmsg, finished, Creature::get_moves(), global_square_location(), is_autodriving, m_warning, no_visibility, ok, Character::omt_path, orientation_diff(), player_in_control(), pldrive(), signum(), skidding, slow_down, stop_autodriving(), to_orientation(), turn_dir, velocity, VMIPH_PER_TPS, and coords::coord_point< Point, Origin, Scale, InBounds >::xy().
Referenced by autodrive_activity_actor::do_turn().
| void vehicle::do_engine_damage | ( | vehicle_part & | vp, |
| int | strain | ||
| ) |
Definition at line 5608 of file vehicle.cpp.
References _, add_msg(), damage_direct(), engine_fuel_left(), get_map(), is_engine_on(), is_perpetual_type(), min(), one_in(), rng(), and strain().
Referenced by thrust().
|
private |
Definition at line 3983 of file vehicle.cpp.
References get_all_parts(), get_map(), get_weather(), map::is_outside(), and very_light.
Referenced by gain_moves().
| bool vehicle::do_remove_part_actual | ( | ) |
Definition at line 2105 of file vehicle.cpp.
References item_stack::clear(), map::clear_vehicle_point_from_cache(), vehicle_part::fake_part_to, get_items(), get_map(), global_part_pos3(), vehicle_part::is_fake, vehicle_part::is_real_or_active_fake(), parts, and vehicle_part::removed.
Referenced by part_removal_cleanup(), and remove_fake_parts().
| void vehicle::do_towing_move | ( | ) |
Definition at line 6656 of file vehicle.cpp.
References _, add_msg(), clamp(), debugmsg, disp_name(), face, get_angle_from_targ(), get_map(), get_tow_part(), towing_data::get_towed(), get_turn_from_angle(), map::getabs(), map::getlocal(), global_part_pos3(), global_pos3(), global_square_location(), ui_manager::invalidate(), invalidate_towing(), line_to(), m_info, move, map::move_vehicle(), no_towing_slack(), point, coords::coord_point_mut< Point, Subpoint, InBounds >::raw(), rl_dist(), selfdrive(), skidding, TOW_BACK, tow_data, towing_data::tow_direction, TOW_FRONT, velocity, tripoint::x, tripoint::xy(), tripoint::y, and tripoint::z.
Referenced by map::move_vehicle().
| int vehicle::drain | ( | const itype_id & | ftype, |
| int | amount, | ||
| const std::function< bool(vehicle_part &)> & | filter = return_true< vehicle_part &>, |
||
| bool | apply_loss = true |
||
| ) |
Definition at line 3604 of file vehicle.cpp.
References discharge_battery(), filter, fuel_type_battery, global_part_pos3(), invalidate_mass(), and parts.
Referenced by act_vehicle_siphon(), act_vehicle_unload_fuel(), veh_interact::do_siphon(), drain(), turret_data::post_fire(), veh_app_interact::siphon(), use_autoclave(), use_dishwasher(), use_vehicle_tool(), and use_washing_machine().
| int vehicle::drain | ( | int | index, |
| int | amount, | ||
| bool | apply_loss = true |
||
| ) |
Definition at line 3639 of file vehicle.cpp.
References vehicle_part::ammo_consume(), vehicle_part::ammo_current(), vehicle_part::ammo_remaining(), debugmsg, drain(), fuel_type_battery, global_part_pos3(), invalidate_mass(), vehicle_part::is_tank(), vehicle_part::name(), and parts.
| units::energy vehicle::drain_energy | ( | const itype_id & | ftype, |
| units::energy | wanted_energy | ||
| ) |
Consumes enough fuel by energy content.
Does not support cable draining.
| ftype | Type of fuel |
| wanted_energy | Desired amount of energy of fuel to consume |
Definition at line 4847 of file vehicle.cpp.
References invalidate_mass(), and parts.
Referenced by consume_fuel().
| void vehicle::drive_to_local_target | ( | const tripoint & | target, |
| bool | follow_protocol | ||
| ) |
Definition at line 730 of file vehicle.cpp.
References _, sounds::alert, autopilot_on, Character::current_movement_mode(), get_angle_from_targ(), get_map(), get_player_character(), get_turn_from_angle(), map::getabs(), global_pos3(), global_square_location(), Character::in_vehicle, is_flying_in_air(), is_patrolling, is_rotorcraft(), min(), mount_max, move_mode::move_speed_mult(), name, point, Creature::pos(), precollision_check(), coords::coord_point_mut< Point, Subpoint, InBounds >::raw(), refresh(), rl_dist(), safe_velocity(), selfdrive(), sounds::sound(), stop(), stop_autodriving(), string_format(), velocity, and point::y.
Referenced by autopilot_patrol(), and map::vehmove().
| void vehicle::enable_patrol | ( | ) |
Definition at line 830 of file vehicle_use.cpp.
References autodrive_local_target, autopilot_on, engine_on, is_patrolling, start_engines(), and tripoint_zero.
Referenced by autopilot_patrol_check().
| void vehicle::enable_refresh | ( | ) |
Definition at line 6148 of file vehicle.cpp.
References coeff_air_changed, coeff_air_dirty, coeff_rolling_dirty, coeff_water_dirty, mass_center_no_precalc_dirty, mass_center_precalc_dirty, mass_dirty, no_refresh, and refresh().
Referenced by vehicles::finalize_prototypes(), and remove_carried_vehicle().
| bool vehicle::enclosed_at | ( | const tripoint & | pos | ) |
Definition at line 7067 of file vehicle.cpp.
References get_parts_at(), pos, refresh_insides(), and working.
Referenced by monster::monster_move_in_vehicle(), Character::move_in_vehicle(), Character::process_effects(), monster::process_effects(), and Character::stagger().
|
private |
Definition at line 575 of file vehicle_use.cpp.
References get_weather(), global_part_pos3(), vehicle_part::has_fault_flag(), vpart_info::has_flag(), vehicle_part::info(), max(), min(), pos, and units::to_fahrenheit().
Referenced by engine_start_time(), and start_engine().
| int vehicle::engine_fuel_left | ( | const vehicle_part & | vp | ) | const |
Definition at line 3576 of file vehicle.cpp.
References vehicle_part::fuel_current(), and fuel_left().
Referenced by auto_select_fuel(), do_engine_damage(), engine_start_time(), noise_and_smoke(), smart_controller_handle_turn(), and total_power().
| units::power vehicle::engine_fuel_usage | ( | const vehicle_part & | vp | ) | const |
Fuel usage for specific engine.
| e | is the index of the engine in the engines array |
Definition at line 4822 of file vehicle.cpp.
References vpart_info::energy_consumption, vehicle_part::has_fault_flag(), vehicle_part::info(), is_engine_on(), and is_perpetual_type().
Referenced by fuel_usage(), and smart_controller_handle_turn().
|
private |
Definition at line 590 of file vehicle_use.cpp.
References vehicle_part::damage_percent(), engine_cold_factor(), engine_fuel_left(), time_duration::from_moves(), vpart_info::has_flag(), vehicle_part::info(), is_engine_on(), min(), part_vpower_w(), and units::to_watt().
Referenced by start_engine(), and start_engines().
| tripoint vehicle::exhaust_dest | ( | int | part | ) | const |
Definition at line 8306 of file vehicle.cpp.
References coord_translate(), global_pos3(), part(), parts, relative_parts, tripoint, velocity, and point::x.
Referenced by idle(), and spew_field().
|
private |
Definition at line 7430 of file vehicle.cpp.
References vehicle_part::ammo_remaining(), vehicle_part::ammo_unset(), damage_heat, explosion_handler::explosion(), fuel_explosion_data::explosion_chance_cold, fuel_explosion_data::explosion_chance_hot, fuel_explosion_data::explosion_factor, fuel_explosion_data::fiery_explosion, fuel_explosion_data::fuel_size_factor, fuel_tank_explodes, vpart_info::fuel_type, get_event_bus(), item::get_explosion_data(), global_part_pos3(), item::has_explosion_data(), vehicle_part::hp(), vehicle_part::info(), vehicle_part::is_broken(), item, leak_fuel(), mod_hp(), name, one_in(), event_bus::send(), and type.
Referenced by damage_direct().
| rl_vec2d vehicle::face_vec | ( | ) | const |
Definition at line 1613 of file vehicle_move.cpp.
References angle_to_vec(), tileray::dir(), and face.
Referenced by MapExtras::burned_ground_parser(), game::calc_driving_offset(), forward_velocity(), get_angle_from_targ(), game::get_veh_dir_indicator_location(), handling_difficulty(), part_vpower_w(), possibly_recover_from_skid(), map::vehicle_vehicle_collision(), and velo_vec().
|
private |
Definition at line 440 of file turret.cpp.
References automatic, manual, turret_data::query(), turret_data::ready, turret_query(), and turrets().
Referenced by turrets_aim_and_fire_all_manual(), and turrets_override_automatic_aim().
| bool vehicle::find_and_split_vehicles | ( | map & | here, |
| std::set< int > | exclude | ||
| ) |
Definition at line 2275 of file vehicle.cpp.
References all_parts_at_location(), flag_APPLIANCE(), four_adjacent_offsets, vehicle_part::info(), vpart_info::location, part_location_structure(), parts, parts_at_relative(), point_zero, vehicle_part::removed, shift_parts(), and split_vehicles().
Referenced by break_off(), veh_interact::complete_vehicle(), and separate_from_grid().
| std::vector< std::vector< int > > vehicle::find_lines_of_parts | ( | int | part, |
| const std::string & | flag | ||
| ) | const |
Returns all parts in the vehicle that have the specified flag in their vpinfo and are on the same X-axis or Y-axis as the input part and are contiguous with each other.
| part | The part to find adjacent parts to |
| flag | The flag to match |
Definition at line 3120 of file vehicle.cpp.
References abs(), get_avail_parts(), get_non_fake_part(), vpart_info::has_flag(), vpart_info::id, vehicle_part::info(), vehicle_part::is_unavailable(), vehicle_part::mount, part(), parts, point::x, and point::y.
Referenced by can_close(), find_vehicles_to_rack(), find_vehicles_to_unrack(), lock_or_unlock(), and open_or_close().
|
static |
Find a possibly off-map vehicle.
If necessary, loads up its submap through the global MAPBUFFER and pulls it from there. For this reason, you should only give it the coordinates of the origin tile of a target vehicle.
| where | Location of the other vehicle's origin tile. |
Definition at line 5344 of file vehicle.cpp.
References get_map(), mapbuffer::lookup_submap(), MAPBUFFER, pos, coords::coord_point_mut< Point, Subpoint, InBounds >::raw(), coords::sm, and map::veh_at().
Referenced by get_connected_vehicles(), get_remote_part(), item::link_to(), item::process_link(), and search_connected_vehicles().
| std::vector< vehicle::rackable_vehicle > vehicle::find_vehicles_to_rack | ( | int | rack | ) | const |
Definition at line 1528 of file vehicle.cpp.
References find_lines_of_parts(), four_cardinal_directions, get_all_parts(), get_map(), global_part_pos3(), name, and map::veh_at().
Referenced by build_bike_rack_menu().
| std::vector< vehicle::unrackable_vehicle > vehicle::find_vehicles_to_unrack | ( | int | rack | ) | const |
Definition at line 1579 of file vehicle.cpp.
References carried_flag, vehicle_part::carried_name(), carrying_flag, find_lines_of_parts(), four_cardinal_directions, vehicle_part::has_flag(), vehicle_part::mount, vehicle::unrackable_vehicle::name, name, part(), vehicle::unrackable_vehicle::parts, parts, parts_at_relative(), vehicle::unrackable_vehicle::racks, and real_parts().
Referenced by build_bike_rack_menu(), and merge_rackable_vehicle().
| time_duration vehicle::folding_time | ( | ) | const |
Definition at line 7607 of file vehicle.cpp.
References generic_vehicle_part_range< range_type >::begin(), generic_vehicle_part_range< range_type >::end(), get_all_parts(), vpart_info::get_folding_time(), vehicle_part::info(), and part().
Referenced by vehicle_folding_activity_actor::vehicle_folding_activity_actor().
| float vehicle::forward_velocity | ( | ) | const |
Definition at line 1580 of file vehicle_move.cpp.
References dot(), rl_vec2d::dot_product(), face_vec(), move_vec(), and velocity.
Referenced by map::draw_maptile(), pldrive(), and selfdrive().
| int vehicle::fuel_capacity | ( | const itype_id & | ftype | ) | const |
Definition at line 3581 of file vehicle.cpp.
References itype::ammo, vehicle_part::ammo_capacity(), batteries, generic_vehicle_part_range< range_type >::begin(), generic_vehicle_part_range< range_type >::end(), fuel_type_battery, get_all_parts(), parts, and search_connected_vehicles().
Referenced by print_fuel_indicator(), and display::vehicle_fuel_percent_text_color().
| std::list< item * > vehicle::fuel_items_left | ( | ) |
All the individual fuel items that are in all the tanks in the vehicle.
Definition at line 7583 of file vehicle.cpp.
References parts.
| int64_t vehicle::fuel_left | ( | const itype_id & | ftype, |
| const std::function< bool(const vehicle_part &)> & | filter = return_true<const vehicle_part &> |
||
| ) | const |
Definition at line 3516 of file vehicle.cpp.
References vehicle_part::ammo_current(), vehicle_part::ammo_remaining(), avail_part_with_feature(), vehicle_part::base, batteries, item::empty(), vehicle_part::enabled, filter, flag_PERPETUAL, fuel_containers, vpart_info::fuel_type, fuel_type_battery, fuel_type_muscle, get_map(), get_player_character(), Character::get_working_leg_count(), vpart_info::has_flag(), Character::has_two_arms_lifting(), vehicle_part::info(), vehicle_part::is_tank(), item, item::legacy_front(), item::made_of(), part(), parts, player_in_control(), Creature::pos(), search_connected_vehicles(), SOLID, map::veh_at(), and VPFLAG_ENGINE.
Referenced by act_vehicle_unload_fuel(), turret_data::ammo_remaining(), auto_select_fuel(), beeper_sound(), build_electronics_menu(), can_enable(), consume_fuel(), control_engines(), engine_fuel_left(), activity_handlers::fill_liquid_do_turn(), has_security_working(), honk_horn(), is_alternator_on(), pickveh(), turret_data::prepare_fire(), print_fuel_indicator(), turret_data::query(), game::remoteveh(), iuse::remoteveh_tick(), tool_ammo_available(), update_time(), use_autoclave(), use_dishwasher(), use_washing_machine(), and display::vehicle_fuel_percent_text_color().
| std::map< itype_id, units::power > vehicle::fuel_usage | ( | ) | const |
Maps used fuel to its basic (unscaled by load/strain) consumption.
Definition at line 4834 of file vehicle.cpp.
References engine_fuel_usage(), engines, vehicle_part::fuel_current(), is_perpetual_type(), parts, and cata::hash64_detail::ret.
Referenced by consume_fuel(), and smart_controller_handle_turn().
| std::map< itype_id, int > vehicle::fuels_left | ( | ) | const |
All the fuels that are in all the tanks in the vehicle, nicely summed up.
Note that empty tanks don't count at all. The value is the amount as it would be reported by fuel_left, it is always greater than 0. The key is the fuel item type.
Definition at line 7572 of file vehicle.cpp.
References parts.
Referenced by act_vehicle_unload_fuel(), turret_data::ammo_options(), and veh_interact::cant_do().
| void vehicle::gain_moves | ( | ) |
Definition at line 6051 of file vehicle.cpp.
References abs(), automatic_fire_turret(), beeper_sound(), check_environmental_effects, check_falling_or_floating(), cruise_velocity, do_environmental_effects(), fuel_used_last_turn, get_connected_vehicles(), get_player_character(), is_falling, is_following, is_moving(), is_on_ramp, is_patrolling, is_rotorcraft(), loose_parts, of_turn, of_turn_carry, calendar::once_every(), player_in_control(), shed_loose_parts(), slowdown(), stop(), thrust(), turrets(), and velocity.
Referenced by map::vehmove().
| vehicle_part_range vehicle::get_all_parts | ( | ) | const |
Yields a range containing all parts (including broken ones) that can be iterated over.
Definition at line 8119 of file vehicle.cpp.
Referenced by all_parts_at_location(), MapExtras::burned_ground_parser(), calc_mass_center(), veh_interact::calc_overview(), veh_app_interact::can_refill(), veh_interact::cant_do(), game::chat(), veh_interact::count_durability(), crash_terrain_around(), damage_all(), decrement_summon_timer(), do_environmental_effects(), find_vehicles_to_rack(), vehicle_folding_activity_actor::fold_vehicle(), folding_time(), fuel_capacity(), liquid_handler::get_liquid_target(), veh_interact::get_most_damaged_part(), map::get_moving_vehicle_targets(), get_next_shifted_index(), get_parts_at(), get_printable_fuel_types(), has_part(), init_state(), is_structural_part_removed(), veh_utils::most_repairable_part(), part_at(), parts_at_relative(), veh_app_interact::refill(), refresh(), refresh_insides(), vehicle_prototype::save_vehicle_as_prototype(), veh_interact::select_part(), shift_if_needed(), tell_magic_veh_stop_following(), tell_magic_veh_to_follow(), vehicle_unfolding_activity_actor::unfold_vehicle(), unfolding_time(), and npc::vehicle_danger().
| vehicle_part_with_fakes_range vehicle::get_all_parts_with_fakes | ( | bool | with_inactive = false | ) | const |
Definition at line 8218 of file vehicle.cpp.
Referenced by map::add_vehicle_to_cache(), map::build_seen_cache(), map::do_vehicle_caching(), parts_at_relative(), and map::scent_blockers().
| units::angle vehicle::get_angle_from_targ | ( | const tripoint & | targ | ) | const |
Definition at line 843 of file vehicle.cpp.
References units::atan2(), face_vec(), global_square_location(), coords::coord_point_mut< Point, Subpoint, InBounds >::raw(), rl_vec2d::x, point::x, tripoint::xy(), rl_vec2d::y, and point::y.
Referenced by do_towing_move(), and drive_to_local_target().
| vehicle_part_with_feature_range< std::string > vehicle::get_any_parts | ( | std::string | feature | ) | const |
Yields a range of parts of this vehicle that each have the given feature and not removed.
The enabled status of the part is ignored.
Definition at line 3037 of file vehicle.cpp.
References any, and feature().
Referenced by act_vehicle_siphon(), build_bike_rack_menu(), build_electronics_menu(), veh_app_interact::can_siphon(), veh_interact::cant_do(), veh_interact::display_stats(), vehicle_folding_activity_actor::fold_vehicle(), map::generate_lightmap(), get_tow_part(), item::link_to(), merge_rackable_vehicle(), MapExtras::mx_helicopter(), map::process_items_in_vehicle(), refresh_active_item_cache(), vehicle_prototype::save_vehicle_as_prototype(), and veh_app_interact::siphon().
| vehicle_part_with_feature_range< vpart_bitflags > vehicle::get_any_parts | ( | vpart_bitflags | f | ) | const |
Definition at line 3043 of file vehicle.cpp.
| vehicle_part_with_feature_range< std::string > vehicle::get_avail_parts | ( | std::string | feature | ) | const |
Yields a range of parts of this vehicle that each have the given feature and are available: not broken, removed, or part of a carried vehicle.
The enabled status of the part is ignored.
Definition at line 3007 of file vehicle.cpp.
References available, feature(), and working.
Referenced by add_electronic_toggle(), beeper_sound(), boarded_parts(), build_interact_menu(), veh_interact::can_potentially_install(), veh_interact::can_self_jack(), control_doors(), map::detach_vehicle(), disable_smart_controller_if_needed(), npc::execute_action(), find_lines_of_parts(), get_riders(), hackveh(), honk_horn(), pickveh(), pldrive(), relocate_passengers(), remote_controlled(), iuse::remoteveh(), smart_controller_handle_turn(), turrets_set_targeting(), and veh_interact::update_part_requirements().
| vehicle_part_with_feature_range< vpart_bitflags > vehicle::get_avail_parts | ( | vpart_bitflags | f | ) | const |
Definition at line 3015 of file vehicle.cpp.
| bounding_box vehicle::get_bounding_box | ( | bool | use_precalc = true, |
| bool | no_fake = false |
||
| ) |
Definition at line 8056 of file vehicle.cpp.
References b, face, get_points(), tileray::init(), part_at(), parts, point, precalc_mounts(), turn_dir, point::x, and point::y.
Referenced by merge_appliance_into_grid(), and MapExtras::mx_helicopter().
| void vehicle::get_connected_vehicles | ( | std::unordered_set< vehicle * > & | dest | ) |
Returns a map of connected vehicle pointers to power loss factor: Keys are vehicles connected by POWER_TRANSFER parts, includes self Values are line loss, 0.01 corresponds to 1% charge loss to wire resistance May load the connected vehicles' submaps Templated to support const and non-const vehicle*.
Definition at line 5423 of file vehicle.cpp.
References find_vehicle(), get_connected_vehicles(), vpart_info::has_flag(), vehicle_part::info(), loose_parts, part(), vehicle_part::target, and VPFLAG_POWER_TRANSFER.
Referenced by gain_moves(), get_connected_vehicles(), and map::vehmove().
| std::vector< std::tuple< point, int, std::string > > vehicle::get_debug_overlay_data | ( | ) | const |
Definition at line 1264 of file vehicle_autodrive.cpp.
References active_autodrive_controller, autodrive_local_target, collision_check_points, vehicle_profile::collision_points, color(), corner, auto_navigation_data::current_omt, catacurses::cyan, tileray::dir(), face, node_address::facing_dir, node_address::get_point(), global_square_location(), auto_navigation_data::goal_points, auto_navigation_data::goal_zone, catacurses::green, coord_transformation::inverse(), auto_navigation_data::is_obstacle, NAV_MAP_SIZE_X, NAV_MAP_SIZE_Y, auto_navigation_data::nav_to_map, NAV_VIEW_SIZE_X, NAV_VIEW_SIZE_Y, vehicle_profile::occupied_zone, OMT_SIZE, auto_navigation_data::path, point, point_zero, navigation_step::pos, auto_navigation_data::profile(), coords::coord_point_mut< Point, Subpoint, InBounds >::raw(), catacurses::red, cata::hash64_detail::ret, navigation_step::steering_dir, to_orientation(), to_string(), coord_transformation::transform(), tripoint_zero, auto_navigation_data::valid_position(), auto_navigation_data::view_to_map, catacurses::white, point::x, point::y, and catacurses::yellow.
| vpart_display vehicle::get_display_of_tile | ( | const point & | dp, |
| bool | rotate = true, |
||
| bool | include_fake = true, |
||
| bool | below_roof = true, |
||
| bool | roof = true |
||
| ) | const |
Definition at line 59 of file vehicle_display.cpp.
References vehicle_part::blood, c_light_red, c_red, vpart_info::color, vpart_info::color_broken, iexamine::curtains(), debugmsg, tileray::dir(), face, get_items(), vpart_variant::get_symbol(), vpart_variant::get_symbol_curses(), vpart_info::has_flag(), vpart_info::id, vehicle_part::info(), invert_color(), vehicle_part::is_broken(), vehicle_part::open, part(), part_displayed_at(), part_with_feature(), parts, cata::hash64_detail::ret, rotate(), string_id< T >::str(), vehicle_part::variant, vpart_info::variants, VPFLAG_ARMOR, VPFLAG_CARGO, VPFLAG_CURTAIN, VPFLAG_OPENABLE, VPFLAG_WINDOW, point::x, and point::y.
Referenced by veh_interact::display_veh(), map::draw_from_above(), map::draw_maptile(), and vehicle_prototype::save_vehicle_as_prototype().
|
private |
Definition at line 6479 of file vehicle.cpp.
References left, parts, point_east, point_north, point_south, point_west, relative_parts, and right.
Referenced by refresh().
| vehicle_part_with_feature_range< std::string > vehicle::get_enabled_parts | ( | std::string | feature | ) | const |
Yields a range of parts of this vehicle that each have the given feature and are enabled and available: not broken, removed, or part of a carried vehicle.
Definition at line 3050 of file vehicle.cpp.
References available, enabled, feature(), and working.
Referenced by crash_terrain_around(), operate_planter(), operate_reaper(), operate_scoop(), play_chimes(), play_music(), power_parts(), and transform_terrain().
| vehicle_part_with_feature_range< vpart_bitflags > vehicle::get_enabled_parts | ( | vpart_bitflags | f | ) | const |
Definition at line 3060 of file vehicle.cpp.
| std::pair< int, double > vehicle::get_exhaust_part | ( | ) | const |
Definition at line 8290 of file vehicle.cpp.
References vpart_info::bonus, vehicle_part::health_percent(), vehicle_part::info(), mufflers, part(), and parts.
Referenced by idle(), and noise_and_smoke().
| item vehicle::get_folded_item | ( | ) | const |
Definition at line 7625 of file vehicle.cpp.
References _, JsonError::c_str(), debugmsg, units::legacy_volume_factor, name, parts, real_parts(), item::set_damage(), item::set_var(), string_format(), units::to_milligram(), to_string(), total_mass(), tracking_on, calendar::turn, unfolding_time(), and JsonOut::write().
Referenced by vehicle_folding_activity_actor::fold_vehicle().
| monster * vehicle::get_harnessed_animal | ( | ) | const |
Definition at line 1293 of file vehicle_move.cpp.
References effect_harnessed, effect_pet, vpart_info::fuel_type, fuel_type_animal, get_monster(), Creature::has_effect(), vehicle_part::info(), and parts.
Referenced by game::control_vehicle(), game::grabbed_veh_move(), player_in_control(), pldrive(), selfdrive(), and steering_effectiveness().
| vehicle_stack vehicle::get_items | ( | const vehicle_part & | vp | ) | const |
Definition at line 5922 of file vehicle.cpp.
References get_items().
Referenced by add_charges(), add_item(), calc_mass_center(), veh_interact::complete_vehicle(), MapExtras::delete_items_at_mount(), do_remove_part_actual(), get_display_of_tile(), get_items(), advanced_inv_area::get_vehicle_stack(), vpart_reference::items(), monster::monster_move_in_vehicle(), map::mop_spills(), Character::move_in_vehicle(), operate_planter(), npc::pick_up_item_vehicle(), print_part_list(), Character::process_effects(), monster::process_effects(), map::process_items_in_vehicle(), process_vehicle_items(), remove_part(), vehicle_prototype::save_vehicle_as_prototype(), map::terrain_moppable(), use_autoclave(), use_dishwasher(), and use_washing_machine().
| vehicle_stack vehicle::get_items | ( | vehicle_part & | vp | ) |
Definition at line 5917 of file vehicle.cpp.
| monster * vehicle::get_monster | ( | int | p | ) | const |
Definition at line 3412 of file vehicle.cpp.
References creature_tracker::creature_at(), get_creature_tracker(), global_part_pos3(), part_with_feature(), and VPFLAG_BOARDABLE.
Referenced by activate_animal_follow(), calc_mass_center(), damage_direct(), get_harnessed_animal(), monster::move(), part_collision(), part_vpower_w(), precollision_check(), and thrust().
| int vehicle::get_next_shifted_index | ( | int | original_index, |
| Character & | you | ||
| ) | const |
Definition at line 3091 of file vehicle.cpp.
References get_all_parts(), and Creature::get_value().
Referenced by veh_interact::complete_vehicle(), and vehicle_activity().
| int vehicle::get_non_fake_part | ( | int | part_num | ) | const |
Definition at line 8108 of file vehicle.cpp.
References debugmsg, disp_name(), vehicle_part::fake_part_to, vehicle_part::is_fake, part_count(), and parts.
Referenced by build_interact_menu(), can_close(), damage(), find_lines_of_parts(), map::move_vehicle(), and map::vehicle_vehicle_collision().
|
inline |
|
inline |
Definition at line 977 of file vehicle.h.
References owner.
Referenced by veh_interact::do_main_loop(), vehicle_part::get_targeting_npc(), handle_potential_theft(), is_owned_by(), place_spawn_items(), and place_zones().
| std::string vehicle::get_owner_name | ( | ) | const |
Definition at line 4668 of file vehicle.cpp.
References _, debugmsg, disp_name(), g, and owner.
Referenced by veh_interact::display_name(), and handle_potential_theft().
| std::vector< vehicle_part * > vehicle::get_parts_at | ( | const tripoint & | pos, |
| const std::string & | flag, | ||
| part_status_flag | condition | ||
| ) |
Get all enabled, available, unbroken vehicle parts at specified position.
| pos | position to check |
| flag | if set only flags with this part will be considered |
| condition | enum to include unabled, unavailable, and broken parts |
Definition at line 2855 of file vehicle.cpp.
References enabled, get_all_parts(), global_pos3(), pos, and working.
Referenced by map::add_vehicle_to_map(), build_interact_menu(), can_do_activity_there(), enclosed_at(), get_parts_at(), idle(), make_active(), monster::monster_move_in_vehicle(), Character::move_in_vehicle(), MapExtras::mx_helicopter(), Character::process_effects(), monster::process_effects(), and turret_query().
| std::vector< const vehicle_part * > vehicle::get_parts_at | ( | const tripoint & | pos, |
| const std::string & | flag, | ||
| part_status_flag | condition | ||
| ) | const |
Definition at line 2882 of file vehicle.cpp.
References enabled, get_all_parts(), global_pos3(), pos, and working.
| std::vector< vehicle_part * > vehicle::get_parts_at | ( | const tripoint_bub_ms & | pos, |
| const std::string & | flag, | ||
| part_status_flag | condition | ||
| ) |
Definition at line 2875 of file vehicle.cpp.
References get_parts_at(), and pos.
| vehicle_part_with_feature_range< std::string > vehicle::get_parts_including_carried | ( | std::string | feature | ) | const |
Yields a range of parts of this vehicle that each have the given feature and are not broken or removed.
The enabled status of the part is ignored.
Definition at line 3023 of file vehicle.cpp.
References feature(), and working.
Referenced by init_state(), and map::process_items_in_vehicle().
| vehicle_part_with_feature_range< vpart_bitflags > vehicle::get_parts_including_carried | ( | vpart_bitflags | f | ) | const |
Definition at line 3030 of file vehicle.cpp.
| Character * vehicle::get_passenger | ( | int | you | ) | const |
Definition at line 3403 of file vehicle.cpp.
References g, part_with_feature(), parts, passenger_flag, and VPFLAG_BOARDABLE.
Referenced by act_on_map(), calc_mass_center(), npc::execute_action(), vpart_reference::get_passenger(), is_passenger(), part_vpower_w(), and split_vehicles().
| const std::set< tripoint > & vehicle::get_points | ( | bool | force_refresh = false, |
| bool | no_fake = false |
||
| ) | const |
Definition at line 7725 of file vehicle.cpp.
References tileray::dir(), face, global_part_pos3(), global_pos3(), vehicle_part::is_fake, occupied_cache_direction, occupied_cache_pos, occupied_points, part(), and relative_parts.
Referenced by map::add_vehicle_to_map(), Creature::auto_find_hostile_target(), check_falling_or_floating(), check_heli_ascend(), check_heli_descend(), game::control_vehicle(), map::detach_vehicle(), map::draw_maptile(), get_bounding_box(), overmap_ui::get_overmap_path_to(), map::memory_clear_vehicle_points(), map::move_vehicle(), MapExtras::mx_burned_ground(), part_collision(), veh_app_interact::refill(), veh_app_interact::remove(), sees_veh(), veh_interact::serialize_activity(), stop(), and vehicle_activity().
| std::vector< itype_id > vehicle::get_printable_fuel_types | ( | ) | const |
Returns an array of fuel types that can be printed.
Definition at line 313 of file vehicle_display.cpp.
References vehicle_part::ammo_current(), carried_flag, get_all_parts(), vehicle_part::has_flag(), vehicle_part::is_fuel_store(), and string_id< T >::is_null().
Referenced by veh_app_interact::draw_info(), veh_app_interact::init_ui_windows(), veh_interact::move_fuel_cursor(), and print_fuel_indicators().
| std::optional< vpart_reference > vehicle::get_remote_part | ( | const vehicle_part & | vp_local | ) | const |
Get the remote vehicle and part that a part is targeting.
Useful for, e.g. power cables that have a vehicle part on both sides.
| vp_local | Vehicle part that is connected to the remote part. |
Definition at line 6950 of file vehicle.cpp.
References find_vehicle(), get_map(), map::getabs(), global_part_pos3(), loose_parts, parts, vehicle_part::target, and VPFLAG_POWER_TRANSFER.
Referenced by part_to_item(), remove_remote_part(), and shed_loose_parts().
| std::vector< rider_data > vehicle::get_riders | ( | ) | const |
Definition at line 3373 of file vehicle.cpp.
References creature_tracker::creature_at(), get_avail_parts(), get_creature_tracker(), rider_data::prt, rider_data::psg, and VPFLAG_BOARDABLE.
Referenced by map::displace_vehicle(), and map::shake_vehicle().
| safe_reference< vehicle > vehicle::get_safe_reference | ( | ) |
Return a pointer-like type that's automatically invalidated if this item is destroyed or assigned-to.
Definition at line 248 of file vehicle.cpp.
References anchor, and safe_reference_anchor::reference_to().
Referenced by item::link_to(), and item::process_link().
| const std::vector< item > & vehicle::get_tools | ( | const vehicle_part & | vp | ) | const |
Definition at line 5932 of file vehicle.cpp.
References vehicle_part::tools.
| std::vector< item > & vehicle::get_tools | ( | vehicle_part & | vp | ) |
Definition at line 5927 of file vehicle.cpp.
References vehicle_part::tools.
Referenced by calc_mass_center(), vehicles::finalize_prototypes(), and vehicle_prototype::save_vehicle_as_prototype().
| int vehicle::get_tow_part | ( | ) | const |
Definition at line 6782 of file vehicle.cpp.
References get_any_parts().
Referenced by do_towing_move(), has_tow_attached(), invalidate_towing(), no_towing_slack(), serialize(), set_tow_directions(), static_drag(), and tow_cable_too_far().
| int vehicle::get_z_change | ( | ) | const |
Definition at line 4407 of file vehicle.cpp.
References requested_z_change.
| tripoint_abs_omt vehicle::global_omt_location | ( | ) | const |
Definition at line 3426 of file vehicle.cpp.
References global_square_location().
Referenced by overmapbuffer::add_vehicle(), overmap_ui::get_overmap_path_to(), overmapbuffer::remove_vehicle(), and total_wind_epower().
| tripoint vehicle::global_part_pos3 | ( | const int & | index | ) | const |
Get the coordinates of the studied part of the vehicle.
Definition at line 3442 of file vehicle.cpp.
References parts.
Referenced by add_item(), map::add_vehicle_to_cache(), automatic_fire_turret(), backfire(), break_off(), map::build_seen_cache(), can_close(), can_use_rails(), check_falling_or_floating(), veh_interact::complete_vehicle(), control_doors(), damage_direct(), map::displace_vehicle(), do_remove_part_actual(), do_towing_move(), map::do_vehicle_caching(), drain(), engine_cold_factor(), npc::execute_action(), explode_fuel(), find_vehicles_to_rack(), map::generate_lightmap(), get_monster(), get_points(), get_remote_part(), vehicle_part::get_targeting_npc(), game::grabbed_veh_move(), idle(), turret_data::in_range(), invalidate_towing(), leak_fuel(), level_vehicle(), merge_rackable_vehicle(), merge_vehicle_parts(), target_handler::mode_turrets(), map::move_vehicle(), no_towing_slack(), item_location::impl::item_on_vehicle::obtain_cost(), operate_scoop(), veh_app_interact::plug(), vpart_position::pos(), item_location::impl::item_on_vehicle::position(), power_parts(), put_into_vehicle(), refresh(), refresh_zones(), remove_carried_vehicle(), remove_part(), DefaultRemovePartHandler::removed(), serialize(), serialize_liquid_source(), serialize_liquid_target(), map::shake_vehicle(), shed_loose_parts(), slow_leak(), split_vehicles(), start_engine(), static_drag(), stop_engines(), total_solar_epower(), total_water_wheel_epower(), total_wind_epower(), tow_cable_too_far(), turrets_aim(), turrets_aim_and_fire(), turrets_set_mode(), turrets_set_targeting(), unboard_all(), update_time(), target_ui::update_turrets_in_range(), vehicle_caching_internal(), vehicle_caching_internal_above(), map::vehicle_vehicle_collision(), and map::vehicle_wheel_traction().
| tripoint vehicle::global_part_pos3 | ( | const vehicle_part & | pt | ) | const |
Definition at line 3447 of file vehicle.cpp.
References global_pos3(), and vehicle_part::precalc.
| tripoint vehicle::global_pos3 | ( | ) | const |
Definition at line 3431 of file vehicle.cpp.
References pos, sm_pos, and sm_to_ms_copy().
Referenced by act_on_map(), alarm(), MapExtras::burned_ground_parser(), check_is_heli_landed(), collision(), veh_interact::complete_vehicle(), decrement_summon_timer(), veh_interact::display_veh(), do_towing_move(), drive_to_local_target(), exhaust_dest(), get_parts_at(), get_points(), map::get_vehicles(), global_part_pos3(), global_square_location(), game::grabbed_veh_move(), has_part(), idle(), immediate_path(), level_vehicle(), merge_vehicle_parts(), mount_to_tripoint(), veh_interact::move_cursor(), map::move_vehicle(), noise_and_smoke(), orient_part(), pickveh(), pos_bub(), power_parts(), precalculate_vehicle_turning(), map::process_items(), item::process_link(), veh_app_interact::refill(), veh_interact::serialize_activity(), serialize_liquid_source(), game::setremoteveh(), slow_leak(), npc::vehicle_danger(), and map::vehicle_vehicle_collision().
| tripoint_abs_ms vehicle::global_square_location | ( | ) | const |
Definition at line 3421 of file vehicle.cpp.
References get_map(), and global_pos3().
Referenced by map::add_vehicle_to_map(), autopilot_patrol(), autopilot_patrol_check(), build_interact_menu(), do_autodrive(), do_towing_move(), drive_to_local_target(), get_angle_from_targ(), get_debug_overlay_data(), global_omt_location(), item::link_to(), overmapbuffer::move_vehicle(), set_submap_moved(), total_solar_epower(), and update_time().
| int vehicle::ground_acceleration | ( | bool | fueled = true, |
| int | at_vel_in_vmi = -1 |
||
| ) | const |
Definition at line 3752 of file vehicle.cpp.
References add_msg_debug, cmps_to_vmiph(), debugmode::DF_VEHICLE, engine_on, towing_data::get_towed(), is_towing(), max(), max_velocity(), name, skidding, units::to_kilogram(), units::to_watt(), total_mass(), total_power(), tow_data, and vmiph_to_cmps().
Referenced by acceleration(), and veh_interact::display_stats().
| bool vehicle::handle_potential_theft | ( | Character const & | you, |
| bool | check_only = false, |
||
| bool | prompt = true |
||
| ) |
Definition at line 4686 of file vehicle.cpp.
References _, Character::add_faction_warning(), Creature::as_character(), Creature::as_npc(), npc::as_npc(), g, get_avatar(), Character::get_faction(), get_owner(), get_owner_name(), Character::getID(), has_old_owner(), has_owner(), faction_template::id, npc::is_friendly(), Character::is_npc(), is_owned_by(), npc::make_angry(), MAX_VIEW_DISTANCE, Creature::pos(), Pickup::prompt, Character::query_yn(), remove_old_owner(), rl_dist(), npc::say(), Character::sees(), set_old_owner(), set_owner(), theft_time, and calendar::turn.
Referenced by doors::close_door(), game::control_vehicle(), veh_interact::do_main_loop(), game::grabbed_veh_move(), doors::lock_door(), avatar_action::move(), open(), veh_menu::query(), smash(), and doors::unlock_door().
| void vehicle::handle_trap | ( | const tripoint & | p, |
| vehicle_part & | vp_wheel | ||
| ) |
Definition at line 1218 of file vehicle_move.cpp.
References _, Character::add_known_trap(), add_msg(), trap::can_see(), vehicle_handle_trap_data::chance, sounds::combat, vehicle_handle_trap_data::damage, damage_direct(), debugmsg, direction_from(), direction_name(), vehicle_handle_trap_data::do_explosion, vpart_info::durability, explosion_handler::explosion(), get_map(), get_player_character(), vpart_info::has_flag(), string_id< T >::id(), vehicle_part::info(), vehicle_handle_trap_data::is_falling, trap::is_null(), m_bad, trap::name(), vehicle_part::name(), name, player_in_control(), Creature::pos(), map::remove_trap(), vehicle_handle_trap_data::remove_trap, rng(), roll_remainder(), Character::sees(), vehicle_handle_trap_data::set_trap, vehicle_handle_trap_data::shrapnel, sounds::sound(), vehicle_handle_trap_data::sound, vehicle_handle_trap_data::sound_type, vehicle_handle_trap_data::sound_variant, vehicle_handle_trap_data::sound_volume, map::spawn_item(), vehicle_handle_trap_data::spawn_items, map::tr_at(), map::trap_set(), trap::vehicle_data, and VPFLAG_WHEEL.
Referenced by game::grabbed_veh_move(), and map::move_vehicle().
| float vehicle::handling_difficulty | ( | ) | const |
Returns roughly driving skill level at which there is no chance of fumbling.
Definition at line 4807 of file vehicle.cpp.
References dir_vec(), face_vec(), get_map(), k_traction(), max(), steering_effectiveness(), velocity, and vehicles::vmiph_per_tile.
Referenced by pldrive(), and selfdrive().
| bool vehicle::has_available_electric_engine | ( | ) |
Definition at line 5785 of file vehicle.cpp.
References vehicle_part::enabled, engines, fuel_type_battery, vehicle_part::is_available(), is_engine_type(), and parts.
Referenced by disable_smart_controller_if_needed(), and install_part().
| std::optional< std::string > vehicle::has_engine_conflict | ( | const vpart_info & | possible_conflict | ) | const |
Definition at line 978 of file vehicle.cpp.
References vpart_info::engine_info, engines, vehicle_part::info(), and parts.
Referenced by can_mount(), and veh_interact::update_part_requirements().
| bool vehicle::has_engine_type | ( | const itype_id & | ft, |
| bool | enabled | ||
| ) | const |
Definition at line 957 of file vehicle.cpp.
References enabled, engines, is_engine_on(), is_engine_type(), and parts.
Referenced by assign_veh_to_follow(), game::chat(), game::control_vehicle(), max_reverse_velocity(), player_in_control(), pldrive(), tell_veh_stop_following(), and thrust().
| bool vehicle::has_engine_type_not | ( | const itype_id & | ft, |
| bool | enabled | ||
| ) | const |
Definition at line 967 of file vehicle.cpp.
References enabled, engines, is_engine_on(), is_engine_type(), and parts.
Referenced by build_interact_menu(), idle(), and init_state().
|
inline |
Definition at line 986 of file vehicle.h.
References string_id< T >::is_null(), and old_owner.
Referenced by handle_potential_theft().
|
inline |
Definition at line 983 of file vehicle.h.
References string_id< T >::is_null(), and owner.
Referenced by map::apply_faction_ownership(), veh_interact::do_main_loop(), handle_potential_theft(), init_state(), place_spawn_items(), and place_zones().
| bool vehicle::has_part | ( | const std::string & | flag, |
| bool | enabled = false |
||
| ) | const |
Check if vehicle has at least one unbroken part with specified flag.
| flag | Specified flag to search parts for |
| enabled | if set part must also be enabled to be considered |
Definition at line 2827 of file vehicle.cpp.
References enabled, and get_all_parts().
Referenced by build_electronics_menu(), build_interact_menu(), veh_interact::can_remove_part(), veh_interact::do_repair(), liquid_handler::get_liquid_target(), idle(), install_part(), on_move(), map::process_items_in_vehicle(), refresh(), selfdrive(), start_engine(), turrets_set_targeting(), and veh_interact::update_part_requirements().
| bool vehicle::has_part | ( | const tripoint & | pos, |
| const std::string & | flag, | ||
| bool | enabled = false |
||
| ) | const |
Check if vehicle has at least one unbroken part with specified flag.
| pos | limit check for parts to this global position |
| flag | The specified flag |
| enabled | if set part must also be enabled to be considered |
Definition at line 2838 of file vehicle.cpp.
References enabled, get_all_parts(), global_pos3(), and pos.
| bool vehicle::has_security_working | ( | ) | const |
Definition at line 1038 of file vehicle.cpp.
References fuel_left(), fuel_type_battery, vpart_info::has_flag(), vehicle_part::info(), vehicle_part::is_available(), part(), and speciality.
Referenced by alarm(), build_interact_menu(), hotwire_car_activity_actor::finish(), and hackveh().
|
private |
Definition at line 1153 of file vehicle.cpp.
References carried_flag, vpart_info::has_flag(), vehicle_part::has_flag(), vehicle_part::info(), vpart_info::location, part(), part_location_structure(), and parts_at_relative().
Referenced by can_mount().
| bool vehicle::has_sufficient_rotorlift | ( | ) | const |
Definition at line 4385 of file vehicle.cpp.
References lift_thrust_of_rotorcraft(), units::to_kilogram(), and total_mass().
Referenced by is_rotorcraft().
| bool vehicle::has_tag | ( | const std::string & | tag | ) | const |
Definition at line 8322 of file vehicle.cpp.
References tags.
Referenced by construct::check_no_wiring(), is_appliance(), is_powergrid(), place_appliance(), and refresh().
| bool vehicle::has_tow_attached | ( | ) | const |
Definition at line 6790 of file vehicle.cpp.
References get_tow_part().
Referenced by item::link_to().
| void vehicle::honk_horn | ( | ) | const |
Definition at line 840 of file vehicle_use.cpp.
References _, add_msg(), sounds::alarm, vpart_info::bonus, fuel_left(), fuel_type_battery, get_avail_parts(), vpart_info::id, sounds::sound(), and vpart_horn_bicycle.
Referenced by build_interact_menu().
| void vehicle::idle | ( | bool | on_map | ) |
Definition at line 5623 of file vehicle.cpp.
References _, add_msg_if_player_sees(), alarm(), alternator_load, avg_velocity, turret_data::base(), consume_fuel(), crash_terrain_around(), cruise_velocity, vpart_info::emissions, map::emit_field(), emitters, vehicle_part::enabled, engine_on, vpart_info::exhaust, exhaust_dest(), fuel_type_animal, fuel_type_mana, fuel_type_muscle, fuel_type_wind, get_exhaust_part(), get_map(), get_parts_at(), get_player_character(), global_part_pos3(), global_pos3(), has_engine_type_not(), has_part(), vehicle_part::info(), is_alarm_on, is_following, is_patrolling, vehicle_part::is_unavailable(), linked_item_epower_this_turn, name, noise_and_smoke(), parts, planters, play_chimes(), play_music(), player_in_control(), Creature::pos(), item_location::position(), power_parts(), item::process(), smart_controller_handle_turn(), total_power(), calendar::turn, turret_query(), turrets(), update_time(), velocity, warm_enough_to_plant(), and working.
| std::set< point > vehicle::immediate_path | ( | const units::angle & | rotate = 0_degrees | ) |
Definition at line 682 of file vehicle.cpp.
References tileray::advance(), collision_check_points, coord_translate(), tileray::dir(), tileray::dx(), tileray::dy(), face, front_left, front_right, get_map(), map::getabs(), global_pos3(), tileray::init(), line_to(), normalize(), point, rotate(), round_to_multiple_of(), vehicles::steer_increment, velocity, and tripoint::xy().
Referenced by precollision_check().
| int vehicle::index_of_part | ( | const vehicle_part * | part, |
| bool | include_removed = false |
||
| ) | const |
Definition at line 3224 of file vehicle.cpp.
References part(), parts, and vehicle_part::removed.
Referenced by turret_data::base(), break_off(), can_do_activity_there(), can_unmount(), damage_direct(), veh_interact::do_mend(), veh_interact::do_siphon(), part_vpower_w(), precollision_check(), veh_app_interact::refill(), veh_app_interact::remove(), remove_part(), veh_interact::select_part(), veh_interact::serialize_activity(), veh_app_interact::siphon(), vehicle_activity(), and would_repair_prevent_flyable().
| void vehicle::init_state | ( | map & | placed_on, |
| int | init_veh_fuel, | ||
| int | init_veh_status | ||
| ) |
Definition at line 292 of file vehicle.cpp.
References vehicle_part::ammo_current(), vehicle_part::ammo_unset(), auto_select_fuel(), vehicle_part::blood, broken, clamp(), dice(), vpart_info::durability, vehicle_part::enabled, engine_on, engines, fault_engine_immobiliser, vehicle_part::fault_set(), vehicle_part::faults_potential(), fuel_type_muscle, get_all_parts(), get_parts_including_carried(), has_engine_type_not(), vpart_info::has_flag(), has_owner(), vehicle_part::info(), vehicle_part::is_available(), vehicle_part::is_battery(), vehicle_part::is_fuel_store(), is_locked, vehicle_part::is_reactor(), vehicle_part::is_tank(), itype_battery, itype_plut_cell, last_update, max(), normal_roll(), one_in(), vehicle_part::open, open(), parts, passenger_flag, rand(), random_entry(), refresh(), vehicle_part::remove_flag(), rng(), set_hp(), smash(), calendar::turn, calendar::turn_zero, valid_wheel_config(), VPFLAG_AISLE_LIGHT, VPFLAG_ATOMIC_LIGHT, VPFLAG_CIRCLE_LIGHT, VPFLAG_CONE_LIGHT, VPFLAG_DOME_LIGHT, VPFLAG_ENGINE, VPFLAG_HALF_CIRCLE_LIGHT, VPFLAG_REACTOR, VPFLAG_WIDE_CONE_LIGHT, and wheelcache.
Definition at line 1450 of file vehicle.cpp.
References item, string_id< T >::obj(), and type.
Referenced by map::add_vehicle_to_map(), veh_interact::complete_vehicle(), construct::done_vehicle(), vehicles::finalize_prototypes(), install_part(), item::link_to(), place_appliance(), veh_utils::repair_part(), and vehicle_prototype::save_vehicle_as_prototype().
Definition at line 1455 of file vehicle.cpp.
References install_part(), and type.
| int vehicle::install_part | ( | const point & | dp, |
| const vpart_id & | type, | ||
| item && | base, | ||
| std::vector< item > & | installed_with | ||
| ) |
| int vehicle::install_part | ( | const point & | dp, |
| vehicle_part && | vp | ||
| ) |
Definition at line 1466 of file vehicle.cpp.
References can_mount(), coeff_air_changed, debugmsg, sfx::do_vehicle_engine_sfx(), vehicle_part::enabled, engine_on, vpart_info::fuel_type, fuel_type_battery, has_available_electric_engine(), has_enabled_smart_controller, vpart_info::has_flag(), has_part(), vpart_info::id, vehicle_part::mount, parts, refresh(), remove_fake_parts(), ret_val_common::str(), string_id< T >::str(), and ret_val_common::success().
| void vehicle::interact_with | ( | const tripoint & | p, |
| bool | with_pickup = false |
||
| ) |
Definition at line 2434 of file vehicle_use.cpp.
References _, build_interact_menu(), debugmsg, get_map(), veh_menu::query(), veh_menu::reset(), tripoint::to_string(), and map::veh_at().
Referenced by game::control_vehicle(), and iuse::remoteveh().
| void vehicle::invalidate_mass | ( | ) |
Mark mass caches and pivot cache as dirty.
Definition at line 7986 of file vehicle.cpp.
References coeff_rolling_dirty, coeff_water_dirty, mass_center_no_precalc_dirty, mass_center_precalc_dirty, mass_dirty, and pivot_dirty.
Referenced by act_vehicle_siphon(), add_item(), build_interact_menu(), veh_interact::complete_vehicle(), damage_direct(), drain(), drain_energy(), game::grabbed_veh_move(), item_location::impl::item_on_vehicle::on_contents_changed(), refresh(), remove_item(), map::unboard_vehicle(), update_time(), and use_monster_capture().
| void vehicle::invalidate_towing | ( | bool | first_vehicle = false, |
| Character * | remover = nullptr |
||
| ) |
Definition at line 6828 of file vehicle.cpp.
References map::add_item_or_charges(), Character::can_stash(), towing_data::clear_towing(), deliberate, flag_NO_DROP, get_map(), get_tow_part(), towing_data::get_towed(), towing_data::get_towed_by(), global_part_pos3(), item::has_flag(), Character::i_add_or_drop(), invalidate_towing(), is_towed(), is_towing(), item::link(), item::link_to(), vehicle_part::mount, no_link, part(), part_to_item(), parts, point, put_into_vehicle_or_drop(), remove_part(), item::reset_link(), item::set_damage(), item::link_data::source, item::link_data::target, tow_data, and vehicle_tow.
Referenced by break_off(), veh_interact::complete_vehicle(), damage_direct(), map::detach_vehicle(), do_towing_move(), invalidate_towing(), merge_rackable_vehicle(), map::move_vehicle(), and unlink_cables().
| bool vehicle::is_alternator_on | ( | const vehicle_part & | vp | ) | const |
Definition at line 1020 of file vehicle.cpp.
References vehicle_part::enabled, engines, vehicle_part::fuel_current(), fuel_left(), vehicle_part::has_fault_flag(), vehicle_part::is_available(), vehicle_part::is_unavailable(), vehicle_part::mount, and parts.
Referenced by total_alternator_epower(), total_power(), and update_alternator_load().
| bool vehicle::is_appliance | ( | ) | const |
Definition at line 1445 of file vehicle.cpp.
References flag_APPLIANCE(), and has_tag().
Referenced by build_interact_menu(), can_do_activity_there(), is_foldable(), refresh(), and split_vehicles().
|
private |
Performs a breadth-first search from one part to another, to see if a path exists between the two without going through the excluded part.
Used to see if a part can be legally removed.
| to | The part to reach. |
| from | The part to start the search from. |
| excluded_part | The part that is being removed and, therefore, should not be included in the path. |
Definition at line 1395 of file vehicle.cpp.
References carried_flag, four_adjacent_offsets, vpart_info::has_flag(), vehicle_part::has_flag(), vehicle_part::info(), vpart_info::location, vehicle_part::mount, part_location_structure(), parts, and parts_at_relative().
Referenced by can_unmount().
| bool vehicle::is_engine_on | ( | const vehicle_part & | vp | ) | const |
Definition at line 1015 of file vehicle.cpp.
References vehicle_part::enabled, and vehicle_part::is_available().
Referenced by do_engine_damage(), engine_fuel_usage(), engine_start_time(), has_engine_type(), has_engine_type_not(), is_engine_type_on(), noise_and_smoke(), print_fuel_indicators(), smart_controller_handle_turn(), start_engine(), start_engines(), activity_handlers::start_engines_finish(), stop_engines(), total_engine_epower(), total_power(), update_alternator_load(), and display::vehicle_fuel_percent_text_color().
| bool vehicle::is_engine_type | ( | const vehicle_part & | vp, |
| const itype_id & | ft | ||
| ) | const |
Definition at line 1000 of file vehicle.cpp.
References vehicle_part::ammo_current(), vehicle_part::fuel_current(), and string_id< T >::is_null().
Referenced by has_available_electric_engine(), has_engine_type(), has_engine_type_not(), is_engine_type_on(), print_fuel_indicators(), smart_controller_handle_turn(), start_engine(), activity_handlers::start_engines_finish(), stop_engines(), and display::vehicle_fuel_percent_text_color().
| bool vehicle::is_engine_type_combustion | ( | const vehicle_part & | vp | ) | const |
Definition at line 1005 of file vehicle.cpp.
References flag_E_COMBUSTION(), vpart_info::has_flag(), and vehicle_part::info().
Referenced by noise_and_smoke(), and smart_controller_handle_turn().
| bool vehicle::is_engine_type_on | ( | const vehicle_part & | vp, |
| const itype_id & | ft | ||
| ) | const |
Definition at line 952 of file vehicle.cpp.
References is_engine_on(), and is_engine_type().
Referenced by basic_consumption().
| bool vehicle::is_external_part | ( | const tripoint & | part_pt | ) | const |
Definition at line 6737 of file vehicle.cpp.
References get_map(), map::points_in_radius(), and map::veh_at().
Referenced by item::link_to().
| bool vehicle::is_flyable | ( | ) | const |
Definition at line 4397 of file vehicle.cpp.
References flyable.
Referenced by damage_direct(), and pldrive().
| bool vehicle::is_flying_in_air | ( | ) | const |
Definition at line 4447 of file vehicle.cpp.
References is_flying.
Referenced by check_heli_ascend(), veh_interact::display_stats(), drive_to_local_target(), overmap_ui::get_overmap_path_to(), map::move_vehicle(), on_move(), pldrive(), thrust(), and wait().
| bool vehicle::is_foldable | ( | ) | const |
Definition at line 7594 of file vehicle.cpp.
References is_appliance(), and real_parts().
Referenced by veh_interact::do_install(), and vehicle_folding_activity_actor::fold_vehicle().
| bool vehicle::is_in_water | ( | bool | deep_water = false | ) | const |
is the vehicle mostly in water or mostly on fairly dry land?
Definition at line 4462 of file vehicle.cpp.
References in_deep_water, and in_water.
Referenced by on_move(), map::vehicle_wheel_traction(), and wait().
| bool vehicle::is_moving | ( | ) | const |
Definition at line 3728 of file vehicle.cpp.
References velocity.
Referenced by build_interact_menu(), gain_moves(), map::get_moving_vehicle_targets(), monster::move(), Character::pause(), thrust(), and npc::vehicle_danger().
| bool vehicle::is_old_owner | ( | const Character & | c, |
| bool | available_to_take = false |
||
| ) | const |
Definition at line 4656 of file vehicle.cpp.
References c, debugmsg, get_old_owner(), string_id< T >::is_null(), and old_owner.
| bool vehicle::is_owned_by | ( | const Character & | c, |
| bool | available_to_take = false |
||
| ) | const |
Definition at line 4644 of file vehicle.cpp.
References c, debugmsg, get_owner(), string_id< T >::is_null(), and owner.
Referenced by assign_veh_to_follow(), game::chat(), veh_interact::display_name(), handle_potential_theft(), tell_magic_veh_to_follow(), and tell_veh_stop_following().
| bool vehicle::is_passenger | ( | Character & | c | ) | const |
Definition at line 3389 of file vehicle.cpp.
References boarded_parts(), c, and get_passenger().
Referenced by on_move(), and part_displayed_at().
| bool vehicle::is_perpetual_type | ( | const vehicle_part & | vp | ) | const |
Definition at line 1010 of file vehicle.cpp.
References flag_PERPETUAL, vpart_info::fuel_type, vehicle_part::info(), and item.
Referenced by basic_consumption(), control_engines(), do_engine_damage(), engine_fuel_usage(), fuel_usage(), print_fuel_indicators(), and display::vehicle_fuel_percent_text_color().
| bool vehicle::is_powergrid | ( | ) | const |
Definition at line 1952 of file vehicle.cpp.
References alternators, batteries, flag_APPLIANCE(), flag_WIRING(), has_tag(), reactors, solar_panels, water_wheels, and wind_turbines.
Referenced by link_up_actor::link_to_veh_app(), part_removal_cleanup(), place_appliance(), veh_app_interact::populate_app_actions(), and split_vehicles().
| bool vehicle::is_rotorcraft | ( | ) | const |
Definition at line 4391 of file vehicle.cpp.
References get_player_character(), has_sufficient_rotorlift(), player_in_control(), and rotors.
Referenced by acceleration(), act_on_map(), check_falling_or_floating(), check_heli_ascend(), check_heli_descend(), collision(), veh_interact::display_stats(), drive_to_local_target(), gain_moves(), overmap_ui::get_overmap_path_to(), k_traction(), level_vehicle(), max_velocity(), map::move_vehicle(), noise_and_smoke(), pldrive(), safe_velocity(), smart_controller_handle_turn(), steering_effectiveness(), and thrust().
|
private |
Returns whether or not the vehicle has a structural part queued for removal,.
Definition at line 1171 of file vehicle.cpp.
References get_all_parts(), and part_location_structure().
Referenced by can_mount().
| bool vehicle::is_towed | ( | ) | const |
Definition at line 6767 of file vehicle.cpp.
References debugmsg, towing_data::get_towed(), towing_data::get_towed_by(), name, cata::hash64_detail::ret, and tow_data.
Referenced by invalidate_towing(), item::link_to(), selfdrive(), split_vehicles(), and static_drag().
| bool vehicle::is_towing | ( | ) | const |
Definition at line 6752 of file vehicle.cpp.
References debugmsg, towing_data::get_towed(), towing_data::get_towed_by(), name, cata::hash64_detail::ret, and tow_data.
Referenced by ground_acceleration(), invalidate_towing(), item::link_to(), map::move_vehicle(), slowdown(), split_vehicles(), thrust(), and water_acceleration().
| bool vehicle::is_watercraft | ( | ) | const |
should vehicle be handled using watercraft logic as determined by amount of water it is in (and whether it is amphibious) result being true does not guarantee it is viable boat – check can_float()
Definition at line 4457 of file vehicle.cpp.
References in_deep_water, in_water, and wheelcache.
Referenced by acceleration(), act_on_map(), k_traction(), max_velocity(), map::move_vehicle(), on_move(), safe_velocity(), slowdown(), steering_effectiveness(), thrust(), map::vehicle_wheel_traction(), and wait().
| bool vehicle::is_wheel_state_correct_to_turn_on_rails | ( | int | wheels_on_rail, |
| int | wheel_count, | ||
| int | turning_wheels_that_are_one_axis | ||
| ) | const |
Definition at line 1800 of file vehicle_move.cpp.
References abs(), all_wheels_on_one_axis, bounding_box::p1, bounding_box::p2, rail_wheel_bounding_box, velocity, and point::x.
Referenced by allow_auto_turn_on_rails(), and allow_manual_turn_on_rails().
| float vehicle::k_traction | ( | float | wheel_traction_area | ) | const |
Traction coefficient of the vehicle.
1.0 on road. Outside roads, depends on mass divided by wheel area and the surface beneath wheels.
Affects safe velocity, acceleration and handling difficulty.
Definition at line 4560 of file vehicle.cpp.
References add_msg_debug, can_float(), debugmode::DF_VEHICLE, in_deep_water, is_flying, is_rotorcraft(), is_watercraft(), max(), min(), name, units::to_kilogram(), total_mass(), and wheel_area().
Referenced by act_on_map(), veh_interact::display_stats(), overmap_ui::get_overmap_path_to(), game::grabbed_veh_move(), handling_difficulty(), smart_controller_handle_turn(), and thrust().
|
private |
empty the contents of a tank, battery or turret spilling liquids randomly on the ground
Definition at line 7545 of file vehicle.cpp.
References map::add_item_or_charges(), vehicle_part::ammo_consume(), vehicle_part::ammo_current(), vehicle_part::ammo_remaining(), vehicle_part::ammo_unset(), closest_points_first(), item::find_type(), get_map(), global_part_pos3(), vehicle_part::is_tank(), item, max(), random_entry(), rng(), and calendar::turn.
Referenced by damage_direct(), and explode_fuel().
| bool vehicle::level_vehicle | ( | ) |
Definition at line 1988 of file vehicle_move.cpp.
References map::displace_vehicle(), get_map(), global_part_pos3(), global_pos3(), map::has_flag(), map::has_flag_ter_or_furn(), is_flying, is_on_ramp, is_rotorcraft(), OVERMAP_DEPTH, part_location_structure(), parts, map::supports_above(), TFLAG_NO_FLOOR, TFLAG_RAMP_DOWN, TFLAG_RAMP_UP, tripoint_below, tripoint::xy(), and tripoint::z.
Referenced by map::level_vehicle().
| int vehicle::lift_strength | ( | ) | const |
Required strength to be able to successfully lift the vehicle unaided by equipment.
Definition at line 946 of file vehicle.cpp.
References total_mass().
Referenced by veh_interact::calc_lift_requirements().
| double vehicle::lift_thrust_of_rotorcraft | ( | bool | fuelled, |
| bool | safe = false |
||
| ) | const |
is the vehicle flying? is it a rotorcraft?
Definition at line 4366 of file vehicle.cpp.
References add_msg_debug, debugmode::DF_VEHICLE, M_PI, name, parts, rotors, iexamine::safe(), units::to_watt(), and total_power().
Referenced by has_sufficient_rotorlift(), max_rotor_velocity(), rotor_acceleration(), and safe_rotor_velocity().
| std::vector< vehicle_part * > vehicle::lights | ( | ) |
Definition at line 4987 of file vehicle.cpp.
References parts.
Referenced by map::generate_lightmap(), and veh_lumi().
| const point & vehicle::local_center_of_mass | ( | ) | const |
Definition at line 3492 of file vehicle.cpp.
References calc_mass_center(), mass_center_no_precalc, and mass_center_no_precalc_dirty.
Referenced by balanced_wheel_config(), veh_interact::display_veh(), and refresh_pivot().
| void vehicle::lock | ( | int | part_index | ) |
Locks a lockable, closed part at the specified index.
If it's a multipart, locks all attached parts as well. Does not affect vehicle is_locked flag.
| part_index | The index in the parts list of the part to lock. |
Definition at line 1240 of file vehicle_use.cpp.
References debugmsg, vpart_info::has_flag(), vehicle_part::info(), lock_or_unlock(), vehicle_part::name(), name, vehicle_part::open, and part().
Referenced by control_doors(), and doors::lock_door().
|
private |
Locks or unlocks a lockable door part at the specified index based on the @locking value passed.
Part must have the OPENABLE and LOCKABLE_DOOR flags, and be closed. If it's a multipart, locks or unlocks all attached parts as well.
| part_index | The index in the parts list of the part to lock or unlock. |
Definition at line 1350 of file vehicle_use.cpp.
References vehicle_part::fake_part_at, vehicle_part::fake_part_to, find_lines_of_parts(), vehicle_part::has_fake, vehicle_part::is_fake, vehicle_part::locked, and parts.
Referenced by control_doors(), lock(), and unlock().
| void vehicle::make_active | ( | item_location & | loc | ) |
Update an item's active status, for example when adding hot or perishable liquid to a container.
Definition at line 5825 of file vehicle.cpp.
References active_items, active_item_cache::add(), any, get_parts_at(), vehicle_part::mount, and item_location::position().
Referenced by item_location::impl::item_on_vehicle::make_active().
| int vehicle::max_ground_velocity | ( | bool | fueled = true | ) | const |
Definition at line 3879 of file vehicle.cpp.
References add_msg_debug, coeff_air_drag(), coeff_rolling_drag(), debugmode::DF_VEHICLE, mps_to_vmiph(), name, vehicles::rolling_constant_to_variable, simple_cubic_solution(), units::to_watt(), and total_power().
Referenced by veh_interact::display_stats(), max_velocity(), and game::place_vehicle_nearby().
| units::power vehicle::max_reactor_epower | ( | ) | const |
Definition at line 5195 of file vehicle.cpp.
References vehicle_part::enabled, part_epower(), parts, and reactors.
Referenced by veh_interact::calc_overview().
| int vehicle::max_reverse_velocity | ( | bool | fueled = true | ) | const |
Definition at line 3933 of file vehicle.cpp.
References fuel_type_battery, has_engine_type(), and max_velocity().
Referenced by cruise_thrust(), and thrust().
| int vehicle::max_rotor_velocity | ( | bool | fueled = true | ) | const |
Definition at line 3913 of file vehicle.cpp.
References coeff_air_drag(), lift_thrust_of_rotorcraft(), min(), mps_to_vmiph(), and sqrt().
Referenced by veh_interact::display_stats(), and max_velocity().
| int vehicle::max_velocity | ( | bool | fueled = true | ) | const |
Definition at line 3922 of file vehicle.cpp.
References is_flying, is_rotorcraft(), is_watercraft(), max_ground_velocity(), max_rotor_velocity(), and max_water_velocity().
Referenced by cruise_thrust(), ground_acceleration(), max_reverse_velocity(), strain(), and thrust().
| int vehicle::max_water_velocity | ( | bool | fueled = true | ) | const |
Definition at line 3902 of file vehicle.cpp.
References add_msg_debug, coeff_air_drag(), coeff_water_drag(), debugmode::DF_VEHICLE, mps_to_vmiph(), name, units::to_watt(), and total_power().
Referenced by veh_interact::display_stats(), max_velocity(), and water_acceleration().
| bool vehicle::merge_appliance_into_grid | ( | vehicle & | veh_target | ) |
Definition at line 1858 of file vehicle.cpp.
References _, abs(), add_msg(), add_tag(), debugmsg, flag_WIRING(), get_avatar(), get_bounding_box(), get_map(), avatar::grab(), Character::grab_point, m_bad, max(), MAX_WIRE_VEHICLE_SIZE, merge_vehicle_parts(), min(), name, NONE, bounding_box::p1, bounding_box::p2, pivot_anchor, point, Creature::pos(), pos, power_grid_name, shift_if_needed(), om_direction::size, translation::translated(), turn_dir, map::veh_at(), VEHICLE, point::x, and point::y.
Referenced by link_up_actor::link_to_veh_app(), and place_appliance().
| bool vehicle::merge_rackable_vehicle | ( | vehicle * | carry_veh, |
| const std::vector< int > & | rack_parts | ||
| ) |
Definition at line 1660 of file vehicle.cpp.
References _, add_msg(), all_parts_at_location(), carried_flag, vehicle_part::carried_stack, carrying_flag, character_id, zone_manager::create_vehicle_loot_zone(), debugmsg, map::destroy_vehicle(), tileray::dir(), map::dirty_vehicle_list, vehicle_part::enabled, face, find_vehicles_to_unrack(), units::fmod(), four_adjacent_offsets, four_cardinal_directions, map::get_abs_sub(), get_any_parts(), zone_manager::get_manager(), get_map(), global_part_pos3(), vehicle_part::has_flag(), map::invalidate_map_cache(), invalidate_towing(), loot_zones, m_bad, vehicle_part::mount, mount_to_tripoint(), name, normalize(), part_location_structure(), parts, parts_at_relative(), passenger_flag, vehicle_part::passenger_id, map::rebuild_vehicle_level_caches(), refresh(), remove_fake_parts(), vehicle_part::remove_flag(), vehicle_part::set_flag(), map::set_seen_cache_dirty(), map::set_transparency_cache_dirty(), sm_pos, tracked_flag, tracking_on, tripoint, tripoint_zero, coords::coord_point_mut< Point, Subpoint, InBounds >::z(), tripoint::z, and zones_dirty.
Referenced by bikerack_racking_activity_actor::finish().
| bool vehicle::merge_vehicle_parts | ( | vehicle * | veh | ) |
Definition at line 1822 of file vehicle.cpp.
References map::add_item_or_charges(), map::destroy_vehicle(), safe_reference< T >::get(), get_map(), global_part_pos3(), global_pos3(), vpart_info::has_flag(), vpart_info::id, vehicle_part::info(), vehicle_part::is_fake, item::link(), magic, vehicle_part::mount, mount_to_tripoint(), part(), part_to_item(), parts, refresh(), remove_fake_parts(), remove_remote_part(), vehicle_part::removed, item::reset_link(), item::link_data::t_veh, vpart_power_cord, VPFLAG_POWER_TRANSFER, and tripoint::xy().
Referenced by merge_appliance_into_grid().
| bool vehicle::mod_hp | ( | vehicle_part & | pt, |
| int | qty | ||
| ) |
Apply damage to part constrained by range [0,durability] possibly destroying it.
| pt | Part being damaged |
| qty | maximum amount by which to adjust damage (negative permissible) |
Definition at line 653 of file vehicle_part.cpp.
References vehicle_part::base, dur, vpart_info::durability, vehicle_part::info(), item::max_damage(), and item::mod_damage().
Referenced by damage_direct(), explode_fuel(), and smash().
Definition at line 3326 of file vehicle.cpp.
References point_zero.
Referenced by item::link_to(), merge_rackable_vehicle(), merge_vehicle_parts(), open_or_close(), veh_app_interact::populate_app_actions(), and veh_app_interact::remove().
Definition at line 3331 of file vehicle.cpp.
References coord_translate(), global_pos3(), pivot_anchor, and pivot_rotation.
| rl_vec2d vehicle::move_vec | ( | ) | const |
Definition at line 1607 of file vehicle_move.cpp.
References angle_to_vec(), tileray::dir(), and move.
Referenced by game::calc_driving_offset(), forward_velocity(), possibly_recover_from_skid(), and velo_vec().
| units::power vehicle::net_battery_charge_rate | ( | bool | include_reactors | ) | const |
Definition at line 5157 of file vehicle.cpp.
References active_reactor_epower(), linked_item_epower_this_turn, total_accessory_epower(), total_alternator_epower(), total_engine_epower(), total_solar_epower(), total_water_wheel_epower(), and total_wind_epower().
Referenced by active_reactor_epower(), veh_interact::calc_overview(), print_fuel_indicator(), and smart_controller_handle_turn().
| int vehicle::next_part_to_close | ( | int | p, |
| bool | outside = false |
||
| ) | const |
Return the index of the next part to close at p
The next part to open is the first opened part in the list of parts at part p's coordinates. Returns -1 for no more to close.
| p | Part who's coordinates provide the location to check |
| outside | If true, give parts that can be closed from outside only |
Definition at line 2928 of file vehicle.cpp.
References vpart_info::has_flag(), vehicle_part::info(), vehicle_part::is_available(), vehicle_part::open, part(), parts, parts_at_relative(), and VPFLAG_OPENABLE.
Referenced by doors::close_door(), and control_doors().
| int vehicle::next_part_to_lock | ( | int | p, |
| bool | outside = false |
||
| ) | const |
Return the index of the next part to lock at part p's location.
The next part to lock is the first closed, unlocked part in the list of parts at part p's coordinates with the lockable_door flag.
| p | part whose coordinates provide the location to check |
| outside | if true, give parts that can be locked from outside only |
Definition at line 2974 of file vehicle.cpp.
References vpart_info::has_flag(), vehicle_part::info(), vehicle_part::is_available(), vehicle_part::locked, vehicle_part::open, part(), part_has_lock(), parts, and parts_at_relative().
Referenced by doors::can_lock_door(), control_doors(), doors::lock_door(), and doors::unlock_door().
| int vehicle::next_part_to_open | ( | int | p, |
| bool | outside = false |
||
| ) | const |
Return the index of the next part to open at p's location.
The next part to open is the first unopened part in the reversed list of parts at part p's coordinates.
| p | Part who's coordinates provide the location to check |
| outside | If true, give parts that can be opened from outside only |
Definition at line 2946 of file vehicle.cpp.
References vpart_info::has_flag(), vehicle_part::info(), vehicle_part::is_available(), vehicle_part::locked, vehicle_part::open, part(), part_has_lock(), parts, parts_at_relative(), and VPFLAG_OPENABLE.
Referenced by doors::close_door(), control_doors(), avatar_action::move(), open(), and map::route().
| int vehicle::next_part_to_unlock | ( | int | p, |
| bool | outside = false |
||
| ) | const |
Return the index of the next part to unlock at part p's location.
The next part to unlock is the first locked part in the list of parts at part p's coordinates with the lockable_door flag.
| p | part whose coordinates provide the location to check |
| outside | if true, give parts that can be unlocked from outside only |
Definition at line 2993 of file vehicle.cpp.
References vpart_info::has_flag(), vehicle_part::info(), vehicle_part::is_available(), vehicle_part::locked, part(), part_has_lock(), parts, and parts_at_relative().
Referenced by doors::can_unlock_door(), can_unmount(), control_doors(), doors::lock_door(), map::route(), and doors::unlock_door().
| bool vehicle::no_towing_slack | ( | ) | const |
Definition at line 6919 of file vehicle.cpp.
References debugmsg, disp_name(), get_map(), get_tow_part(), towing_data::get_towed(), towing_data::get_towed_by(), map::getabs(), global_part_pos3(), rl_dist(), tow_data, and tripoint_zero.
Referenced by do_towing_move().
| void vehicle::noise_and_smoke | ( | int | load, |
| time_duration | time = 1_turns |
||
| ) |
Generate noise or smoke from a vehicle with engines turned on load = how hard the engines are working, from 0.0 until 1.0 time = how many seconds to generated smoke for.
TODO: handle other engine types: muscle / animal / wind / coal / ...
Definition at line 4018 of file vehicle.cpp.
References _, add_msg_debug, backfire(), debugmode::DF_VEHICLE, engine_fuel_left(), vpart_info::engine_info, engine_on, engines, units::fabs(), fd_smoke, get_exhaust_part(), field_type::get_max_intensity(), global_pos3(), vehicle_part::has_fault_flag(), health, vehicle_part::health_percent(), vehicle_part::info(), is_engine_on(), is_engine_type_combustion(), is_rotorcraft(), ammo_effects::load(), max(), min(), sounds::movement, noise, one_in(), part_vpower_w(), parts, rng(), second, sounds::sound(), spew_field(), units::to_watt(), translate_marker, vehicle_noise, and velocity.
Referenced by idle(), power_parts(), and thrust().
| void vehicle::on_move | ( | ) |
Definition at line 5726 of file vehicle.cpp.
References can_float(), can_use_rails(), get_event_bus(), get_player_character(), has_part(), is_falling, is_flying_in_air(), is_in_water(), is_passenger(), is_watercraft(), operate_planter(), operate_reaper(), operate_scoop(), player_in_control(), remote_controlled(), event_bus::send(), skidding, sm_pos, transform_terrain(), vehicle_moves, velocity, and tripoint::z.
Referenced by map::move_vehicle().
| void vehicle::open | ( | int | part_index | ) |
Opens an openable part at the specified index.
If it's a multipart, opens all attached parts as well.
| part_index | The index in the parts list of the part to open. |
Definition at line 1195 of file vehicle_use.cpp.
References debugmsg, vpart_info::has_flag(), vehicle_part::info(), vehicle_part::name(), name, open_or_close(), part(), and VPFLAG_OPENABLE.
Referenced by control_doors(), init_state(), avatar_action::move(), open(), and open_all_at().
| void vehicle::open_all_at | ( | int | p | ) |
Opens everything that can be opened on the same tile as p
Definition at line 1289 of file vehicle_use.cpp.
References vpart_info::has_flag(), vehicle_part::info(), open(), parts, parts_at_relative(), and VPFLAG_OPENABLE.
Referenced by avatar_action::move(), and open().
|
private |
Opens or closes an openable part at the specified index based on the @opening value passed.
If it's a multipart, opens or closes all attached parts as well.
| part_index | The index in the parts list of the part to open or close. |
Definition at line 1307 of file vehicle_use.cpp.
References coeff_air_changed, coeff_air_dirty, vehicle_part::fake_part_at, vehicle_part::fake_part_to, find_lines_of_parts(), get_map(), get_player_character(), vehicle_part::has_fake, insides_dirty, vehicle_part::is_fake, vehicle_part::locked, mount_to_tripoint(), vehicle_part::open, parts, sfx::play_variant_sound(), pos, rl_dist(), map::set_seen_cache_dirty(), map::set_transparency_cache_dirty(), sm_pos, unlock(), and tripoint::z.
Referenced by close(), control_doors(), and open().
| void vehicle::operate_planter | ( | ) |
Definition at line 1072 of file vehicle_use.cpp.
References _, map::add_item(), item_stack::begin(), item::charges, sounds::combat, damage(), damage_bash, item_stack::end(), vehicle_stack::erase(), furn_f_plant_seed, get_enabled_parts(), get_items(), get_map(), map::has_flag(), rng(), map::set(), item::set_age(), sounds::sound(), map::ter(), ter_t_dirt, ter_t_dirtmound, and TFLAG_PLOWABLE.
Referenced by on_move().
| void vehicle::operate_reaper | ( | ) |
Definition at line 1028 of file vehicle_use.cpp.
References _, add_item(), map::add_item_or_charges(), item_stack::begin(), sounds::combat, item_stack::end(), map_stack::erase(), map::furn(), furn_f_plant_harvest, map::furn_set(), get_enabled_parts(), iexamine::get_harvest_items(), get_map(), map::i_at(), map::i_clear(), itype_fungal_seeds, itype_marloss_seed, string_id< furn_t >::NULL_ID(), rng(), iuse::seed(), sounds::sound(), and VPFLAG_CARGO.
Referenced by on_move().
| void vehicle::operate_scoop | ( | ) |
Definition at line 1110 of file vehicle_use.cpp.
References _, add_item(), sounds::combat, item::damage(), get_enabled_parts(), get_map(), global_part_pos3(), map::has_flag(), map::has_items(), map::i_at(), map::i_rem(), item::inc_damage(), units::legacy_volume_factor, item::max_damage(), map::mop_spills(), one_in(), map::points_in_radius(), random_entry_ref(), rng(), sounds::sound(), TFLAG_SEALED, and item::volume().
Referenced by on_move().
| vehicle_part & vehicle::part | ( | int | part_num | ) |
Definition at line 8098 of file vehicle.cpp.
References parts.
Referenced by map::add_splatter(), avail_linkable_part(), avail_part_with_feature(), average_offroad_rating(), break_off(), build_bike_rack_menu(), map::build_seen_cache(), veh_app_interact::can_disconnect(), can_mount(), veh_interact::can_remove_part(), advanced_inv_area::can_store_in_vehicle(), veh_interact::cant_do(), close(), doors::close_door(), coeff_water_drag(), veh_interact::complete_vehicle(), vehicle::autodrive_controller::compute_profile(), control_doors(), damage(), damage_all(), MapExtras::delete_items_at_mount(), map::displace_vehicle(), veh_interact::display_veh(), veh_interact::do_change_shape(), veh_interact::do_remove(), veh_interact::do_repair(), unload_loot_activity_actor::do_turn(), construct::done_vehicle(), map::draw_maptile(), exhaust_dest(), optional_vpart_position::extended_description(), vehicles::finalize_prototypes(), find_lines_of_parts(), find_vehicles_to_unrack(), folding_time(), fuel_left(), generic_multi_activity_check_requirement(), get_connected_vehicles(), get_display_of_tile(), get_exhaust_part(), get_points(), vpart_position::get_tools(), advanced_inv_area::get_vehicle_stack(), game::grabbed_veh_move(), has_quality_from_vpart(), has_security_working(), has_structural_part(), index_of_part(), invalidate_towing(), vpart_position::is_inside(), item::link_to(), lock(), doors::lock_door(), vehicle_part_with_feature_range< feature_type >::matches(), vehicle_part_range::matches(), vehicle_part_with_fakes_range::matches(), max_quality_from_vpart(), merge_vehicle_parts(), map::mop_spills(), vpart_position::mount(), avatar_action::move(), veh_interact::move_cursor(), move_item(), map::move_vehicle(), next_part_to_close(), next_part_to_lock(), next_part_to_open(), next_part_to_unlock(), open(), open(), orient_part(), vpart_reference::part(), part_collision(), part_with_feature(), npc::pick_up_item_vehicle(), place_spawn_items(), pldrive(), veh_app_interact::populate_app_actions(), item::process_link(), process_vehicle_items(), refresh(), refresh_insides(), veh_app_interact::remove(), remove_carried_vehicle(), item_location::impl::item_on_vehicle::remove_item(), remove_remote_part(), DefaultRemovePartHandler::removed(), veh_utils::repair_part(), item::reset_link(), roof_at_part(), map::route(), separate_from_grid(), item_location::impl::item_on_vehicle::serialize(), veh_interact::serialize_activity(), map::shake_vehicle(), shed_loose_parts(), slow_leak(), smash(), smash_security_system(), spew_field(), split_vehicles(), activity_handlers::start_engines_finish(), sufficient_wheel_config(), map::terrain_moppable(), total_accessory_epower(), unfolding_time(), unlink_cables(), unlock(), doors::unlock_door(), item_location::impl::item_on_vehicle::unpack(), veh_interact::update_part_requirements(), use_harness(), use_monster_capture(), vehicle_activity(), display::vehicle_fuel_percent_text_color(), map::vehicle_vehicle_collision(), and map::vehicle_wheel_traction().
| const vehicle_part & vehicle::part | ( | int | part_num | ) | const |
Definition at line 8103 of file vehicle.cpp.
References parts.
| int vehicle::part_at | ( | const point & | dp | ) | const |
Definition at line 3214 of file vehicle.cpp.
References get_all_parts().
Referenced by get_bounding_box(), item::link_to(), veh_app_interact::plug(), veh_app_interact::populate_app_actions(), item::process_link(), veh_app_interact::remove(), and item::reset_link().
| item_location vehicle::part_base | ( | int | p | ) |
Get handle for base item of part.
Definition at line 2553 of file vehicle.cpp.
References parts.
Referenced by veh_interact::do_mend().
| veh_collision vehicle::part_collision | ( | int | part, |
| const tripoint & | p, | ||
| bool | just_detect, | ||
| bool | bash_floor | ||
| ) |
Definition at line 832 of file vehicle_move.cpp.
References _, abs(), Creature::add_effect(), add_msg(), add_msg_debug, Creature::apply_damage(), vehicle_part::base, vpart_info::base_item, map::bash(), map::bash_resistance(), Creature::bleed(), vehicle_part::blood, calc_ray_end(), cata_assert, check_environmental_effects, sounds::combat, creature_tracker::creature_at(), damage_bash, damage_cut, debugmode::DF_VEHICLE_MOVE, tileray::dir(), Creature::disp_name(), map::disp_name(), vpart_info::dmg_mod, effect_bleed, effect_stunned, units::fabs(), creature_tracker::find(), item::find_type(), units::from_degrees(), time_duration::from_turns(), g, Creature::get_armor_type(), get_creature_tracker(), get_map(), get_monster(), get_player_character(), get_points(), Creature::get_random_body_part_of_type(), Creature::get_weight(), vpart_info::has_flag(), map::has_flag(), map::has_flag_ter_or_furn(), Character::hitall(), map::impassable_ter_furn(), Character::in_vehicle, vehicle_part::info(), map::is_bashable_ter_furn(), Creature::is_dead_state(), Creature::is_hallucination(), log(), m_warning, max(), min(), vehicle_part::mount, move, map::move_cost_ter_furn(), vehicle_part::name(), name, one_in(), veh_collision::part, part(), part_with_feature(), parts, pivot_point(), player_in_control(), Creature::pos(), cata::hash64_detail::ret, rng(), rng_float(), Creature::setpos(), sgn(), skidding, sm_pos, sounds::sound(), sqrt(), stop_autodriving(), bash_params::success, terrain_collision_data(), TFLAG_NO_FLOOR, TFLAG_NOCOLLIDE, TFLAG_RAIL, TFLAG_SHORT, TFLAG_SWIMMABLE, TFLAG_TINY, units::to_kilogram(), body_part_type::torso, total_mass(), turn(), type, map::veh_at(), veh_coll_bashable, veh_coll_body, veh_coll_nothing, veh_coll_other, veh_coll_veh, velocity, vertical_velocity, VPFLAG_ARMOR, VPFLAG_ROTOR, VPFLAG_WHEEL, item::weight(), point::x, and tripoint::z.
Referenced by collision().
| int vehicle::part_count | ( | ) | const |
Definition at line 8124 of file vehicle.cpp.
References parts.
Referenced by collision(), veh_interact::complete_vehicle(), vehicles::finalize_prototypes(), generic_multi_activity_check_requirement(), get_non_fake_part(), map::loadn(), vehicle_part_with_fakes_range::matches(), part_removal_cleanup(), veh_app_interact::populate_app_actions(), refresh(), remove_fake_parts(), restore_folded_parts(), separate_from_grid(), vehicle_activity(), and map::vehicle_vehicle_collision().
| int vehicle::part_count_real | ( | ) | const |
Definition at line 8129 of file vehicle.cpp.
References parts.
Referenced by veh_interact::complete_vehicle().
| int vehicle::part_count_real_cached | ( | ) | const |
| int vehicle::part_displayed_at | ( | const point & | dp, |
| bool | include_fake = false, |
||
| bool | below_roof = true, |
||
| bool | roof = true |
||
| ) | const |
Returns which part (as an index into the parts list) is the one that will be displayed for the given square.
Returns -1 if there are no parts in that square.
| dp | The local coordinate. |
| below_roof | Include parts below roof. |
| roof | Include roof parts. |
Definition at line 3246 of file vehicle.cpp.
References get_player_character(), vehicle_part::info(), is_passenger(), vehicle_part::is_real_or_active_fake(), parts, parts_at_relative(), and vpart_info::z_order.
Referenced by map::add_splatter(), get_display_of_tile(), veh_interact::part_at(), vpart_position::part_displayed(), vehicle_prototype::save_vehicle_as_prototype(), and separate_from_grid().
|
private |
Definition at line 1137 of file vehicle.cpp.
References vpart_info::epower, vehicle_part::health_percent(), and vehicle_part::info().
Referenced by active_reactor_epower(), basic_consumption(), max_reactor_epower(), power_parts(), start_engine(), total_alternator_epower(), total_engine_epower(), total_solar_epower(), total_water_wheel_epower(), total_wind_epower(), and update_time().
| bool vehicle::part_has_lock | ( | int | part_index | ) | const |
Definition at line 2963 of file vehicle.cpp.
References vpart_info::has_flag(), vehicle_part::info(), vehicle_part::is_available(), parts, and parts_at_relative().
Referenced by next_part_to_lock(), next_part_to_open(), and next_part_to_unlock().
| void vehicle::part_removal_cleanup | ( | ) |
Definition at line 2133 of file vehicle.cpp.
References map::add_vehicle_to_cache(), coeff_air_changed, coeff_air_dirty, map::destroy_vehicle(), do_remove_part_actual(), get_map(), is_powergrid(), name, part_count(), parts, power_grid_name, refresh(), remove_fake_parts(), shift_if_needed(), and translation::translated().
Referenced by veh_interact::complete_vehicle(), link_up_actor::link_to_veh_app(), place_appliance(), remove_carried_vehicle(), veh_utils::repair_part(), and separate_from_grid().
| item vehicle::part_to_item | ( | const vehicle_part & | vp | ) | const |
Generate the corresponding item from this vehicle part.
It includes the hp (item damage), fuel charges (battery or liquids), aspect, ...
Definition at line 8223 of file vehicle.cpp.
References automatic, vehicle_part::base, item::damage_level(), itype::damage_scale, flag_CABLE_SPOOL, flag_NO_DROP, flag_TOW_CABLE, flag_VEHICLE, get_remote_part(), item::has_flag(), item::link(), item::link_to(), item::reset_link(), item::set_damage(), item::set_degradation(), item::set_flag(), ret_val_common::success(), item::link_data::t_abs_pos, vehicle_part::target, and item::unset_flag().
Referenced by break_off(), veh_interact::can_remove_part(), veh_interact::complete_vehicle(), damage_direct(), invalidate_towing(), merge_vehicle_parts(), remove_part(), removed_part(), shed_loose_parts(), and unlink_cables().
|
private |
wind-powered vehicles have differing power depending on wind direction
Definition at line 1077 of file vehicle.cpp.
References cos(), dot(), rl_vec2d::dot_product(), effect_harnessed, vpart_info::engine_info, face_vec(), units::from_watt(), vpart_info::fuel_type, fuel_type_animal, fuel_type_muscle, fuel_type_wind, get_monster(), get_passenger(), get_weather(), Creature::has_effect(), vpart_info::has_flag(), vehicle_part::health_percent(), index_of_part(), vehicle_part::info(), json_flag_MUSCLE_VEH_BOOST, M_PI, max(), vpart_info::power, sin(), strength, and VPFLAG_ENGINE.
Referenced by backfire(), basic_consumption(), engine_start_time(), noise_and_smoke(), total_power(), and update_alternator_load().
| int vehicle::part_with_feature | ( | const point & | pt, |
| const std::string & | f, | ||
| bool | unbroken | ||
| ) | const |
Returns index of part at mount point pt which has given f flag.
| pt | only returns parts from this mount point |
| f | required flag in part's vpart_info flags collection |
| unbroken | if true also requires the part to be !is_broken |
Definition at line 2785 of file vehicle.cpp.
References vpart_info::has_flag(), vehicle_part::info(), vehicle_part::is_broken(), part(), and parts_at_relative().
Referenced by act_on_map(), avail_part_with_feature(), damage(), damage_all(), get_display_of_tile(), get_monster(), get_passenger(), part_collision(), vpart_position::part_with_feature(), place_spawn_items(), player_in_control(), pldrive(), process_vehicle_items(), refresh(), refresh_insides(), refresh_pivot(), refresh_zones(), remove_part(), map::shake_vehicle(), smash_security_system(), vehicle_caching_internal(), and map::vehicle_vehicle_collision().
| int vehicle::part_with_feature | ( | const point & | pt, |
| vpart_bitflags | f, | ||
| bool | unbroken | ||
| ) | const |
Returns part index at mount point pt which has given f flag.
| pt | only returns parts from this mount point |
| f | required flag in part's vpart_info flags collection |
| unbroken | if true also requires the part to be !is_broken() |
Definition at line 2774 of file vehicle.cpp.
References vpart_info::has_flag(), vehicle_part::info(), vehicle_part::is_broken(), part(), and parts_at_relative().
| int vehicle::part_with_feature | ( | int | p, |
| vpart_bitflags | f, | ||
| bool | unbroken | ||
| ) | const |
Returns p or part index at mount point pt which has given f flag.
| p | index of part to start searching from |
| f | required flag in part's vpart_info flags collection |
| unbroken | if true also requires the part to be !is_broken() |
Definition at line 2759 of file vehicle.cpp.
References vpart_info::has_flag(), vehicle_part::info(), vehicle_part::is_broken(), vehicle_part::mount, part(), and parts_at_relative().
| std::vector< int > vehicle::parts_at_relative | ( | const point & | dp, |
| bool | use_cache, | ||
| bool | include_fake = false |
||
| ) | const |
Definition at line 2569 of file vehicle.cpp.
References get_all_parts(), get_all_parts_with_fakes(), parts, and relative_parts.
Referenced by avail_linkable_part(), break_off(), veh_app_interact::can_disconnect(), can_mount(), can_unmount(), coeff_air_drag(), veh_interact::complete_vehicle(), damage(), MapExtras::delete_items_at_mount(), optional_vpart_position::extended_description(), find_and_split_vehicles(), find_vehicles_to_unrack(), has_quality_from_vpart(), has_structural_part(), is_connected(), max_quality_from_vpart(), merge_rackable_vehicle(), map::mop_spills(), veh_interact::move_cursor(), next_part_to_close(), next_part_to_lock(), next_part_to_open(), next_part_to_unlock(), open_all_at(), part_displayed_at(), part_has_lock(), part_with_feature(), print_part_list(), print_vparts_descs(), refresh_insides(), remove_carried_vehicle(), remove_part(), DefaultRemovePartHandler::removed(), roof_at_part(), shift_if_needed(), smash(), map::terrain_moppable(), and unlink_cables().
| point vehicle::pivot_displacement | ( | ) | const |
Definition at line 3501 of file vehicle.cpp.
References coord_translate(), pivot_anchor, pivot_rotation, and tripoint::xy().
Referenced by game::grabbed_veh_move(), and map::move_vehicle().
| const point & vehicle::pivot_point | ( | ) | const |
Definition at line 6547 of file vehicle.cpp.
References pivot_cache, pivot_dirty, and refresh_pivot().
Referenced by veh_interact::display_veh(), game::grabbed_veh_move(), map::move_vehicle(), part_collision(), and split_vehicles().
| void vehicle::place_spawn_items | ( | ) |
Definition at line 5953 of file vehicle.cpp.
References add_item(), item::ammo_default(), vehicle_prototype::part_def::ammo_qty, item::ammo_set(), vehicle_prototype::part_def::ammo_types, broken, vehicle_item_spawn::chance, debugmsg, get_owner(), has_owner(), item::in_its_container(), vehicle_part::is_broken(), string_id< T >::is_valid(), vehicle_item_spawn::item_groups, vehicle_item_spawn::item_ids, vehicle_prototype::item_spawns, item_group::items_from(), MAGAZINE_WELL, max(), name, one_in(), part(), part_with_feature(), vehicle_prototype::parts, parts, vehicle_item_spawn::pos, vehicle_prototype::part_def::pos, item::put_in(), random_entry(), rng(), rng_float(), roll_remainder(), item::set_itype_variant(), calendar::start_of_cataclysm, type, use_spawn_rate, vehicle_item_spawn::variant_ids, vehicle_item_spawn::with_ammo, vehicle_prototype::part_def::with_ammo, vehicle_item_spawn::with_magazine, point::x, x_in_y(), and point::y.
| void vehicle::place_zones | ( | map & | pmap | ) | const |
Definition at line 6040 of file vehicle.cpp.
References vehicle_prototype::zone_def::filter, map::get_abs_sub(), get_owner(), map::getabs(), has_owner(), string_id< T >::is_valid(), mapgen_place_zone(), vehicle_prototype::zone_def::name, pos, vehicle_prototype::zone_def::pt, tripoint, type, coords::coord_point_mut< Point, Subpoint, InBounds >::z(), vehicle_prototype::zone_defs, and vehicle_prototype::zone_def::zone_type.
Referenced by map::add_vehicle().
| void vehicle::play_chimes | ( | ) | const |
Definition at line 945 of file vehicle_use.cpp.
References _, get_enabled_parts(), sounds::music, one_in(), and sounds::sound().
Referenced by idle().
| void vehicle::play_music | ( | ) | const |
Definition at line 937 of file vehicle_use.cpp.
References get_enabled_parts(), get_player_character(), iuse::play_music(), and Creature::pos().
Referenced by idle().
| bool vehicle::player_in_control | ( | const Character & | p | ) | const |
Definition at line 253 of file vehicle.cpp.
References Character::controlling_vehicle, fuel_type_animal, get_harnessed_animal(), get_map(), has_engine_type(), part_with_feature(), Creature::pos(), remote_controlled(), tags, map::veh_at(), and VPFLAG_CONTROLS.
Referenced by act_on_map(), game::calc_driving_offset(), can_do_activity_there(), game::control_vehicle(), do_autodrive(), map::draw_maptile(), fuel_left(), gain_moves(), handle_trap(), idle(), talker_character_const::is_in_control_of(), is_rotorcraft(), on_move(), part_collision(), Character::pause(), Character::perform_technique(), power_parts(), map::shake_vehicle(), smart_controller_handle_turn(), and thrust().
Player is driving the vehicle.
| p | direction player is steering |
| z | for vertical movement - e.g helicopters |
Definition at line 1415 of file vehicle_move.cpp.
References _, Character::add_msg_if_player(), cruise_thrust(), Character::dex_cur, forward_velocity(), Character::get_dex(), Creature::get_moves(), Character::get_per(), Character::get_proficiency_practice(), Character::get_skill_level(), Character::get_speed(), handling_difficulty(), Character::has_proficiency(), in_deep_water, tileray::init(), is_rotorcraft(), m_bad, m_info, m_warning, max(), min(), Creature::mod_moves(), move, name, one_in(), Character::practice(), proficiency_prof_boat_pilot, proficiency_prof_driver, rng(), rng_float(), Creature::set_moves(), skidding, skill_driving, vehicles::steer_increment, steering_effectiveness(), thrust(), turn(), turn_dir, valid_wheel_config(), velocity, point::x, and point::y.
Referenced by do_autodrive(), and pldrive().
| tripoint_bub_ms vehicle::pos_bub | ( | ) | const |
Definition at line 3436 of file vehicle.cpp.
References global_pos3().
Referenced by bub_part_pos(), map::displace_vehicle(), vehicle_folding_activity_actor::fold_vehicle(), game::grabbed_veh_move(), and shed_loose_parts().
| void vehicle::possibly_recover_from_skid | ( | ) |
Definition at line 1551 of file vehicle_move.cpp.
References _, add_msg(), dice(), dot(), rl_vec2d::dot_product(), units::fabs(), face, face_vec(), last_turn, move, move_vec(), name, skidding, and velocity.
Referenced by map::move_vehicle().
| void vehicle::power_parts | ( | ) |
Definition at line 5236 of file vehicle.cpp.
References _, abs(), add_msg(), vehicle_part::ammo_consume(), vehicle_part::ammo_remaining(), battery_left(), camera_on, charge_battery(), connected_battery_power_level(), discharge_battery(), vehicle_part::enabled, engine_on, vpart_info::epower, get_enabled_parts(), get_player_character(), global_part_pos3(), global_pos3(), vpart_info::has_flag(), vehicle_part::info(), is_alarm_on, vehicle_part::is_unavailable(), max(), min(), name, noise_and_smoke(), part_epower(), parts, player_in_control(), vpart_info::power, power_to_energy_bat(), reactors, Character::sees(), STATIC, units::to_watt(), total_accessory_epower(), total_alternator_epower(), total_engine_epower(), update_alternator_load(), VPFLAG_ENABLED_DRAINS_EPOWER, and x_in_y().
Referenced by idle().
|
private |
Definition at line 1146 of file vehicle.cpp.
References roll_remainder(), and units::to_millijoule().
Referenced by power_parts(), print_fuel_indicator(), start_engine(), and update_time().
| void vehicle::precalc_mounts | ( | int | idir, |
| const units::angle & | dir, | ||
| const point & | pivot | ||
| ) |
Definition at line 3338 of file vehicle.cpp.
References coord_translate(), parts, pivot_anchor, and pivot_rotation.
Referenced by veh_interact::complete_vehicle(), get_bounding_box(), game::grabbed_veh_move(), item::link_to(), map::move_vehicle(), refresh(), restore_folded_parts(), separate_from_grid(), and split_vehicles().
| void vehicle::precalculate_vehicle_turning | ( | units::angle | new_turn_dir, |
| bool | check_rail_direction, | ||
| ter_furn_flag | ter_flag_to_check, | ||
| int & | wheels_on_rail, | ||
| int & | turning_wheels_that_are_one_axis_counter | ||
| ) | const |
Precalculate vehicle turn.
Counts wheels that will land on ter_flag_to_check new_turn_dir - turn direction to calculate falling_only - is vehicle falling check_rail_direction - check if vehicle should land on diagonal/not rail tile (use for trucks only) ter_flag_to_check - terrain flag vehicle wheel should land on Results: &wheels_on_rail - resulting wheels that land on ter_flag_to_check &turning_wheels_that_are_one_axis_counter - number of wheels that are on one axis and will land on rail
Definition at line 1632 of file vehicle_move.cpp.
References abs(), tileray::advance(), coord_translate(), tileray::dir(), tileray::dx(), tileray::dy(), get_map(), global_pos3(), map::has_flag_ter_or_furn(), int_id< T >::id(), tileray::init(), parts, map::ter(), ter_t_railroad_track, ter_t_railroad_track_d, ter_t_railroad_track_d1, ter_t_railroad_track_d2, ter_t_railroad_track_d_on_tie, ter_t_railroad_track_h, ter_t_railroad_track_h_on_tie, ter_t_railroad_track_on_tie, ter_t_railroad_track_v, ter_t_railroad_track_v_on_tie, units::to_degrees(), velocity, wheelcache, tripoint::x, and tripoint::y.
Referenced by allow_auto_turn_on_rails(), and allow_manual_turn_on_rails().
| bool vehicle::precollision_check | ( | units::angle & | angle, |
| map & | here, | ||
| bool | follow_protocol | ||
| ) |
Definition at line 790 of file vehicle.cpp.
References creature_tracker::creature_at(), get_creature_tracker(), get_monster(), get_player_character(), map::getlocal(), immediate_path(), map::impassable_ter_furn(), Character::in_vehicle, index_of_part(), parts, Creature::pos(), precollision_on, sm_pos, stop(), tripoint, map::veh_at(), tripoint::xy(), and tripoint::z.
Referenced by drive_to_local_target().
| int vehicle::prepare_tool | ( | item & | tool | ) | const |
Flags item tool with PSEUDO, if it has MOD pocket then a pseudo_magazine_mod is installed and a pseudo_magazine is inserted into the magazine well pocket with however many ammo charges of the first ammo type required by the tool are available to this vehicle.
| tool | the tool item to modify |
pseudo_magazine or 0 Definition at line 1742 of file vehicle_use.cpp.
References add_msg_debug, item::ammo_capacity(), item::ammo_set(), item::can_link_up(), item::clear_items(), debugmsg, debugmode::DF_VEHICLE, flag_id, itype_pseudo_magazine, item::magazine_default(), MAGAZINE_WELL, min(), MOD, itype::nname(), item::put_in(), item::set_flag(), STATIC, string_id< T >::str(), ret_val_common::success(), tool_ammo_available(), item::type, and item::typeId().
Referenced by prepare_tools(), and use_vehicle_tool().
| std::map< item, int > vehicle::prepare_tools | ( | const vehicle_part & | vp | ) | const |
Definition at line 5937 of file vehicle.cpp.
References vpart_info::get_pseudo_tools(), vehicle_part::info(), item::invlet, prepare_tool(), vehicle_part::tools, and calendar::turn.
Referenced by vpart_position::part_with_tool().
|
private |
Prints a fuel gauge for a vehicle.
| win | Pointer to the window to draw in. |
| p | location to draw at. |
| fuel_type | ID of the fuel type to draw |
| verbose | true if there should be anything after the gauge (either the %, or number) |
| desc | true if the name of the fuel should be at the end |
| fuel_usages | map of fuel types to consumption for verbose |
Definition at line 390 of file vehicle_display.cpp.
Referenced by print_fuel_indicators().
|
private |
Definition at line 397 of file vehicle_display.cpp.
References _, abs(), c_light_gray, c_light_green, c_light_red, itype::color, consumption_per_hour(), debug_mode, item::find_type(), time_duration::from_turns(), fuel_capacity(), fuel_left(), itype_battery, mvwprintz(), net_battery_charge_rate(), item::nname(), point, power_to_energy_bat(), to_string_clipped(), and wprintz().
| void vehicle::print_fuel_indicators | ( | const catacurses::window & | win, |
| const point & | p, | ||
| int | start_index = 0, |
||
| bool | fullsize = false, |
||
| bool | verbose = false, |
||
| bool | desc = false, |
||
| bool | isHorizontal = false |
||
| ) |
Prints all of the fuel indicators of the vehicle.
| win | Pointer to the window to draw in. |
| p | location to draw at. |
| start_index | Starting index in array of fuel gauges to start reading from |
| fullsize | true if it's expected to print multiple rows |
| verbose | true if there should be anything after the gauge (either the %, or number) |
| desc | true if the name of the fuel should be at the end |
| isHorizontal | true if the menu is not vertical |
Definition at line 343 of file vehicle_display.cpp.
References c_light_gray, c_light_green, engines, vehicle_part::fuel_current(), fuel_type_muscle, fuel_used_last_turn, get_printable_fuel_types(), is_engine_on(), is_engine_type(), is_perpetual_type(), min(), mvwprintz(), parts, point, print_fuel_indicator(), and wprintz().
Referenced by veh_interact::display_stats(), and veh_app_interact::draw_info().
| int vehicle::print_part_list | ( | const catacurses::window & | win, |
| int | y1, | ||
| int | max_y, | ||
| int | width, | ||
| int | p, | ||
| int | hl = -1, |
||
| bool | detail = false, |
||
| bool | include_fakes = true |
||
| ) | const |
Prints a list of all parts to the screen inside of a boxed window, possibly highlighting a selected one.
| win | The window to draw in. |
| y1 | The y-coordinate to start drawing at. |
| max_y | Draw no further than this y-coordinate. |
| width | The width of the window. |
| p | The index of the part being examined. |
| hl | The index of the part to highlight (if any). |
| detail | Whether or not to show detailed contents for fuel components. |
Definition at line 143 of file vehicle_display.cpp.
References _, ammo_battery, vehicle_part::ammo_capacity(), vehicle_part::ammo_current(), vehicle_part::ammo_remaining(), c_light_gray, c_light_red, c_yellow, item::find_type(), format_volume(), get_items(), vpart_position::get_label(), catacurses::getmaxx(), vpart_info::has_flag(), hilite(), vehicle_part::info(), vehicle_part::is_fuel_store(), string_id< T >::is_null(), vehicle_part::is_real_or_active_fake(), itype_battery, units::legacy_volume_factor, vpart_info::location, vehicle_stack::max_volume(), mvwprintz(), vehicle_part::name(), item::nname(), part_location_structure(), parts, parts_at_relative(), point, round_up(), itype::stack_size, item_stack::stored_volume(), string_format(), units::to_liter(), trim_and_print(), utf8_width(), volume_units_abbr(), VPFLAG_ARMOR, VPFLAG_CARGO, and wprintz().
Referenced by veh_interact::create_or_get_ui_adaptor(), and game::print_vehicle_info().
| void vehicle::print_speed_gauge | ( | const catacurses::window & | win, |
| const point & | p, | ||
| int | spacing = 0 |
||
| ) | const |
Vehicle speed gauge.
Prints: target speed < current speed speed unit
| spacing | Sets size of space between components |
Definition at line 469 of file vehicle_display.cpp.
References abs(), c_light_blue, c_light_gray, c_light_green, c_light_red, c_red, c_yellow, convert_velocity(), cruise_velocity, mvwprintz(), point, strain(), type, velocity, and VU_VEHICLE.
| void vehicle::print_vparts_descs | ( | const catacurses::window & | win, |
| int | max_y, | ||
| int | width, | ||
| int | p, | ||
| int & | start_at, | ||
| int & | start_limit | ||
| ) | const |
Prints a list of descriptions for all parts to the screen inside of a boxed window.
| win | The window to draw in. |
| max_y | Draw no further than this y-coordinate. |
| width | The width of the window. |
| p | The index of the part being examined. |
| start_at | Which vehicle part to start printing at. |
| start_limit | the part index beyond which the display is full |
Definition at line 241 of file vehicle_display.cpp.
References _, c_dark_gray, c_light_gray, c_light_green, carried_flag, vehicle_part::carried_name(), carrying_flag, colorize(), fold_and_print(), vpart_info::format_description(), vehicle_part::has_flag(), vehicle_part::info(), vehicle_part::is_broken(), max(), min(), vehicle_part::name(), parts, parts_at_relative(), point, string_format(), catacurses::werase(), and catacurses::wnoutrefresh().
Referenced by veh_interact::create_or_get_ui_adaptor().
|
private |
Definition at line 8142 of file vehicle.cpp.
References parts, and cata::hash64_detail::ret.
Referenced by find_vehicles_to_unrack(), get_folded_item(), and is_foldable().
| void vehicle::refresh | ( | bool | remove_fakes = true | ) |
Refreshes all caches and refinds all parts.
Used after the vehicle has had a part added or removed. Makes indices of different part types so they're easy to find. Also calculates power drain.
Definition at line 6179 of file vehicle.cpp.
References accessories, all_wheels_on_one_axis, alternator_load, alternators, batteries, cable_ports, camera_on, check_environmental_effects, coeff_air_dirty, control_req_parts, edges, vpart_info::emissions, emitters, keycode::end, engines, vpart_info::exhaust, extra_drag, vehicle_part::fake_part_at, vehicle_part::fake_part_to, fake_parts, vehicle_part::fake_protrusion_on, floating, front_left, front_right, fuel_containers, funnels, get_all_parts(), get_edge_info(), global_part_pos3(), vpart_info::has_control_req(), has_enabled_smart_controller, vehicle_part::has_fake, vpart_info::has_flag(), has_part(), has_tag(), vehicle_part::info(), insides_dirty, invalidate_mass(), is_appliance(), vpart_edge_info::is_edge_mount(), vehicle_part::is_fake, vpart_edge_info::is_left_edge(), vpart_info::list_order, loose_parts, max(), min(), vehicle_part::mount, mount_max, mount_min, mufflers, no_refresh, occupied_cache_pos, bounding_box::p1, bounding_box::p2, part(), part_count(), part_with_feature(), parts, pivot_anchor, pivot_rotation, planters, point, point_north, point_south, point_zero, vpart_info::power, precalc_mounts(), rail_wheel_bounding_box, rail_wheelcache, reactors, refresh_active_item_cache(), relative_parts, rotors, sails, smart_controller_state, solar_panels, speciality, steering, turret_locations, update_active_fakes(), VPFLAG_ALTERNATOR, VPFLAG_APPLIANCE, VPFLAG_CABLE_PORTS, VPFLAG_ENABLED_DRAINS_EPOWER, VPFLAG_ENGINE, VPFLAG_FLOATS, VPFLAG_NO_LEAK, VPFLAG_POWER_TRANSFER, VPFLAG_RAIL, VPFLAG_REACTOR, VPFLAG_ROTOR, VPFLAG_SOLAR_PANEL, VPFLAG_WHEEL, water_wheels, wheelcache, wind_turbines, point::x, point::y, and zones_dirty.
Referenced by activate_animal_follow(), activate_magical_follow(), damage_direct(), drive_to_local_target(), enable_refresh(), init_state(), install_part(), merge_rackable_vehicle(), merge_vehicle_parts(), part_removal_cleanup(), veh_menu::query(), remove_part(), restore_folded_parts(), shift_if_needed(), shift_parts(), split_vehicles(), start_engines(), stop_engines(), and vehicle().
| void vehicle::refresh_active_item_cache | ( | ) |
Definition at line 6162 of file vehicle.cpp.
References active_items, active_item_cache::add(), item_stack::begin(), keycode::end, item_stack::end(), get_any_parts(), item_stack::items, and VPFLAG_CARGO.
Referenced by refresh().
| void vehicle::refresh_insides | ( | ) |
Definition at line 7078 of file vehicle.cpp.
References four_adjacent_offsets, get_all_parts(), vpart_info::has_flag(), vehicle_part::info(), vehicle_part::inside, insides_dirty, vehicle_part::is_available(), vehicle_part::mount, vehicle_part::open, part(), part_with_feature(), parts_at_relative(), and vehicle_part::removed.
Referenced by enclosed_at(), and vpart_position::is_inside().
|
private |
Definition at line 6556 of file vehicle.cpp.
References debugmsg, vehicle_part::info(), vehicle_part::is_broken(), local_center_of_mass(), vehicle_part::mount, part_with_feature(), parts, pivot_cache, pivot_dirty, round(), valid_wheel_config(), vpart_info::wheel_info, wheelcache, point::x, and point::y.
Referenced by pivot_point().
| bool vehicle::refresh_zones | ( | ) |
Definition at line 8258 of file vehicle.cpp.
References zone_manager::cache_data(), debugmsg, zone_manager::get_manager(), get_map(), map::getabs(), global_part_pos3(), loot_zones, part_with_feature(), zone_data::set_position(), and zones_dirty.
Referenced by map::get_vehicle_zones().
| void vehicle::reload_seeds | ( | const tripoint & | pos | ) |
Definition at line 878 of file vehicle_use.cpp.
References _, Character::cache_get_items_with(), item::count_by_charges(), deliberate, get_player_character(), iexamine::get_seed_entries(), item::is_seed(), itype_null, min(), string_input_popup::only_digits(), pos, put_into_vehicle_or_drop(), string_input_popup::query_int(), iexamine::query_seed(), string_format(), string_input_popup::title(), Character::use_amount(), Character::use_charges(), and string_input_popup::width().
| void vehicle::relocate_passengers | ( | const std::vector< Character * > & | passengers | ) | const |
Definition at line 2363 of file vehicle.cpp.
References get_avail_parts().
Referenced by split_vehicles().
| bool vehicle::remote_controlled | ( | const Character & | p | ) | const |
Definition at line 274 of file vehicle.cpp.
References _, add_msg(), g, get_avail_parts(), m_bad, Creature::pos(), and rl_dist().
Referenced by map::displace_vehicle(), on_move(), and player_in_control().
| bool vehicle::remove_carried_vehicle | ( | const std::vector< int > & | carried_parts, |
| const std::vector< int > & | racks | ||
| ) |
Definition at line 2157 of file vehicle.cpp.
References _, add_msg(), add_msg_debug, map::add_vehicle(), carried_flag, vehicle_part::carried_stack, carrying_flag, debugmsg, debugmode::DF_VEHICLE, tileray::dir(), map::dirty_vehicle_list, enable_refresh(), vehicle_part::enabled, engines, face, map::get_abs_sub(), get_map(), global_part_pos3(), vehicle_part::has_flag(), map::invalidate_map_cache(), vehicle_part::is_broken(), m_bad, m_warning, vehicle_part::mount, vehicle_part::name(), name, normalize(), old_owner, owner, part(), part_removal_cleanup(), parts, parts_at_relative(), map::rebuild_vehicle_level_caches(), vehicle_part::remove_flag(), split_vehicles(), units::to_degrees(), toggle_tracking(), tracked_flag, tripoint_zero, vehicle_prototype_none, tripoint::xy(), and coords::coord_point_mut< Point, Subpoint, InBounds >::z().
Referenced by bikerack_unracking_activity_actor::finish().
|
private |
Definition at line 6516 of file vehicle.cpp.
References debugmsg, do_remove_part_actual(), edges, vehicle_part::fake_part_at, vehicle_part::fake_part_to, fake_parts, vehicle_part::has_fake, part_count(), parts, and vehicle_part::removed.
Referenced by install_part(), merge_rackable_vehicle(), merge_vehicle_parts(), and part_removal_cleanup().
| vehicle_stack::iterator vehicle::remove_item | ( | vehicle_part & | vp, |
| const vehicle_stack::const_iterator & | it | ||
| ) |
Definition at line 5910 of file vehicle.cpp.
References cata::colony< element_type, element_allocator_type, element_skipfield_type >::erase(), invalidate_mass(), and vehicle_part::items.
| bool vehicle::remove_item | ( | vehicle_part & | vp, |
| item * | it | ||
| ) |
Definition at line 5899 of file vehicle.cpp.
References cata::colony< element_type, element_allocator_type, element_skipfield_type >::end(), cata::colony< element_type, element_allocator_type, element_skipfield_type >::get_iterator_from_pointer(), and vehicle_part::items.
Referenced by unload_loot_activity_actor::do_turn(), vehicle_stack::erase(), and move_item().
|
inline |
Definition at line 969 of file vehicle.h.
References string_id< faction >::NULL_ID(), old_owner, and theft_time.
Referenced by handle_potential_theft().
| bool vehicle::remove_part | ( | vehicle_part & | vp | ) |
Mark a part as removed from the vehicle.
| handler | A class that receives various callbacks, e.g. for placing items. This handler is different when called during mapgen (when items need to be placed on the temporary mapgen map), and when called during normal game play (when items go on the main map g->m). |
Definition at line 1966 of file vehicle.cpp.
Referenced by break_off(), veh_interact::complete_vehicle(), damage_direct(), invalidate_towing(), item_location::impl::item_on_vehicle::remove_item(), remove_part(), veh_utils::repair_part(), shed_loose_parts(), smash(), and unlink_cables().
| bool vehicle::remove_part | ( | vehicle_part & | vp, |
| RemovePartHandler & | handler | ||
| ) |
Definition at line 1972 of file vehicle.cpp.
References RemovePartHandler::add_item_or_charges(), animal_flag, coeff_air_changed, debugmsg, vehicle_part::enabled, engine_on, engines, vehicle_part::fake_part_at, vehicle_part::get_base(), get_items(), RemovePartHandler::get_map_ref(), global_part_pos3(), vehicle_part::has_fake, vpart_info::has_flag(), vehicle_part::has_flag(), vpart_info::id, map::inbounds(), index_of_part(), vehicle_part::info(), anonymous_namespace{item_tname.cpp}::label(), labels, loot_zones, magic, vehicle_part::mount, name, part_to_item(), part_with_feature(), parts, parts_at_relative(), passenger_flag, point, pos, refresh(), vehicle_part::remove_flag(), remove_part(), vehicle_part::removed, RemovePartHandler::removed(), rng(), vehicle_part::set_base(), RemovePartHandler::set_floor_cache_dirty(), RemovePartHandler::set_transparency_cache_dirty(), shift_if_needed(), sm_pos, RemovePartHandler::spawn_animal_from_part(), string_id< T >::str(), point::to_string(), tripoint::to_string(), vehicle_part::tools, type, RemovePartHandler::unboard(), VPFLAG_CARGO, VPFLAG_ENGINE, VPFLAG_OPAQUE, VPFLAG_ROOF, tripoint::z, and zones_dirty.
| void vehicle::remove_remote_part | ( | const vehicle_part & | vp_local | ) | const |
Remove the part on a targeted remote vehicle that a part is targeting.
Definition at line 6966 of file vehicle.cpp.
References get_map(), get_remote_part(), part(), map::rebuild_vehicle_level_caches(), and vehicle_part::vehicle.
Referenced by break_off(), veh_interact::complete_vehicle(), damage_direct(), merge_vehicle_parts(), shed_loose_parts(), and unlink_cables().
| item vehicle::removed_part | ( | const vehicle_part & | vp | ) | const |
If the vehicle part has an item it is removed as, transform the item to the item it is removed_as.
Definition at line 8249 of file vehicle.cpp.
References vehicle_part::info(), part_to_item(), vpart_info::removed_item, and cata::hash64_detail::ret.
Referenced by veh_interact::complete_vehicle().
| bool vehicle::restore_folded_parts | ( | const item & | it | ) |
Definition at line 7672 of file vehicle.cpp.
References add_msg_debug, vehicle_part::base, item::damage(), deserialize_parts(), debugmode::DF_VEHICLE, face, json_loader::from_string(), item::get_var(), tileray::init(), vehicle_part::is_fake, last_update, min(), item::mod_damage(), vehicle_part::name(), part_count(), parts, pivot_anchor, pivot_rotation, precalc_mounts(), refresh(), vehicle_part::removed, rng_sequence(), calendar::turn, turn(), and turn_dir.
Referenced by vehicle_unfolding_activity_actor::unfold_vehicle().
| int vehicle::roof_at_part | ( | int | p | ) | const |
Definition at line 3290 of file vehicle.cpp.
References vpart_info::has_flag(), vehicle_part::info(), vpart_info::location, part(), parts, parts_at_relative(), and VPFLAG_ROOF.
Referenced by map::draw_from_above(), and map::valid_move().
| const point & vehicle::rotated_center_of_mass | ( | ) | const |
Definition at line 3484 of file vehicle.cpp.
References calc_mass_center(), and mass_center_precalc.
Referenced by map::vehicle_vehicle_collision().
| int vehicle::rotor_acceleration | ( | bool | fueled = true, |
| int | at_vel_in_vmi = -1 |
||
| ) | const |
Definition at line 3773 of file vehicle.cpp.
References cmps_to_vmiph(), engine_on, is_flying, lift_thrust_of_rotorcraft(), units::to_kilogram(), and total_mass().
Referenced by acceleration(), and veh_interact::display_stats().
| int vehicle::safe_ground_velocity | ( | bool | fueled = true | ) | const |
Definition at line 3946 of file vehicle.cpp.
References coeff_air_drag(), coeff_rolling_drag(), mps_to_vmiph(), vehicles::rolling_constant_to_variable, simple_cubic_solution(), units::to_watt(), and total_power().
Referenced by veh_interact::display_stats(), safe_velocity(), and smart_controller_handle_turn().
| int vehicle::safe_rotor_velocity | ( | bool | fueled = true | ) | const |
Definition at line 3956 of file vehicle.cpp.
References coeff_air_drag(), lift_thrust_of_rotorcraft(), min(), mps_to_vmiph(), and sqrt().
Referenced by veh_interact::display_stats(), and safe_velocity().
| int vehicle::safe_velocity | ( | bool | fueled = true | ) | const |
Definition at line 3972 of file vehicle.cpp.
References is_flying, is_rotorcraft(), is_watercraft(), safe_ground_velocity(), safe_rotor_velocity(), and safe_water_velocity().
Referenced by control_engines(), cruise_thrust(), drive_to_local_target(), and strain().
| int vehicle::safe_water_velocity | ( | bool | fueled = true | ) | const |
Definition at line 3964 of file vehicle.cpp.
References coeff_air_drag(), coeff_water_drag(), mps_to_vmiph(), units::to_watt(), and total_power().
Referenced by veh_interact::display_stats(), and safe_velocity().
| std::map< vpart_reference, float > vehicle::search_connected_batteries | ( | ) |
Returns a map of connected battery references to power loss factor Keys are batteries in vehicles (includes self) connected by POWER_TRANSFER parts Values are line loss, 0.01 corresponds to 1% charge loss to wire resistance May load the connected vehicles' submaps.
Definition at line 5442 of file vehicle.cpp.
References batteries, vehicle_part::is_fake, vpart_reference::part(), and search_connected_vehicles().
Referenced by charge_battery(), discharge_battery(), and has_battery_in_grid().
| std::map< vehicle *, float > vehicle::search_connected_vehicles | ( | ) |
Returns a map of connected vehicle pointers to power loss factor: Keys are vehicles connected by POWER_TRANSFER parts, includes self Values are line loss, 0.01 corresponds to 1% charge loss to wire resistance May load the connected vehicles' submaps Templated to support const and non-const vehicle*.
Definition at line 5413 of file vehicle.cpp.
Referenced by battery_left(), connected_battery_power_level(), fuel_capacity(), fuel_left(), search_connected_batteries(), and search_connected_vehicles().
| std::map< const vehicle *, float > vehicle::search_connected_vehicles | ( | ) | const |
Returns a map of connected vehicle pointers to power loss factor: Keys are vehicles connected by POWER_TRANSFER parts, includes self Values are line loss, 0.01 corresponds to 1% charge loss to wire resistance May load the connected vehicles' submaps Templated to support const and non-const vehicle*.
Definition at line 5418 of file vehicle.cpp.
References search_connected_vehicles().
|
staticprivate |
Returns a map of connected vehicle pointers to power loss factor: Keys are vehicles connected by POWER_TRANSFER parts, includes self Values are line loss, 0.01 corresponds to 1% charge loss to wire resistance May load the connected vehicles' submaps Templated to support const and non-const vehicle*.
Definition at line 5372 of file vehicle.cpp.
References vpart_info::epower, find_vehicle(), vpart_info::has_flag(), vehicle_part::info(), vehicle_part::target, and VPFLAG_POWER_TRANSFER.
Referenced by veh_app_interact::draw_info().
| void vehicle::selfdrive | ( | const point & | p | ) |
vehicle is driving itself
Definition at line 1307 of file vehicle_move.cpp.
References abs(), cruise_thrust(), forward_velocity(), get_harnessed_animal(), handling_difficulty(), has_part(), tileray::init(), is_following, is_towed(), magic, move, rng(), skidding, vehicles::steer_increment, steering_effectiveness(), thrust(), turn(), turn_dir, valid_wheel_config(), velocity, point::x, and point::y.
Referenced by do_towing_move(), and drive_to_local_target().
| void vehicle::separate_from_grid | ( | point | mount | ) |
Definition at line 1912 of file vehicle.cpp.
References _, add_msg(), debugmsg, find_and_split_vehicles(), get_map(), get_player_character(), vehicle_part::name(), name, part(), part_count(), part_displayed_at(), part_removal_cleanup(), pivot_anchor, point, pos, precalc_mounts(), map::rebuild_vehicle_level_caches(), shift_if_needed(), split_vehicles(), point::to_string(), turn_dir, and unlink_cables().
Referenced by veh_app_interact::disconnect().
| void vehicle::serialize | ( | JsonOut & | json | ) | const |
Definition at line 3481 of file savegame_json.cpp.
References JsonOut::end_array(), JsonOut::end_object(), get_tow_part(), global_part_pos3(), JsonOut::member(), move, om_direction::name(), math_opers::pos(), JsonOut::start_array(), JsonOut::start_object(), anonymous_namespace{item_tname.cpp}::tags(), units::to_degrees(), and type.
| void vehicle::set_flyable | ( | bool | val | ) |
Definition at line 4402 of file vehicle.cpp.
References flyable.
Referenced by damage_direct(), veh_interact::do_install(), veh_interact::do_remove(), and veh_interact::do_repair().
| void vehicle::set_flying | ( | bool | new_flying_value | ) |
Definition at line 4452 of file vehicle.cpp.
References is_flying.
| void vehicle::set_hp | ( | vehicle_part & | pt, |
| int | qty, | ||
| bool | keep_degradation, | ||
| int | new_degradation = -1 |
||
| ) |
Set stat for part constrained by range [0,durability].
Definition at line 628 of file vehicle_part.cpp.
References vehicle_part::base, item::degradation(), dur, vpart_info::durability, vehicle_part::info(), max(), item::max_damage(), item::rand_degradation(), item::set_damage(), and item::set_degradation().
Referenced by init_state(), and veh_utils::repair_part().
|
inline |
Definition at line 965 of file vehicle.h.
References old_owner, theft_time, and calendar::turn.
Referenced by handle_potential_theft().
| void vehicle::set_owner | ( | const Character & | c | ) |
|
inline |
Definition at line 973 of file vehicle.h.
References owner.
Referenced by jmapgen_vehicle::apply(), map::apply_faction_ownership(), handle_potential_theft(), and vehicle_unfolding_activity_actor::unfold_vehicle().
| void vehicle::set_submap_moved | ( | const tripoint & | p | ) |
Update the submap coordinates and update the tracker info in the overmap (if enabled).
This should be called only when the vehicle has actually been moved, not when the map is just shifted (in the later case simply set smx/smy directly).
Definition at line 3462 of file vehicle.cpp.
References global_square_location(), overmapbuffer::move_vehicle(), overmap_buffer, sm_pos, tracking_on, and coords::coord_point< Point, Origin, Scale, InBounds >::xy().
Referenced by map::displace_vehicle().
| void vehicle::set_tow_directions | ( | ) |
Definition at line 6795 of file vehicle.cpp.
References abs(), get_tow_part(), length, mount_max, mount_min, parts, point, TOW_BACK, tow_data, towing_data::tow_direction, TOW_FRONT, TOW_SIDE, point::x, and point::y.
Referenced by towing_data::set_towing().
| void vehicle::shed_loose_parts | ( | trinary | shed_cables = trinary::NONE, |
| const tripoint_bub_ms * | dst = nullptr |
||
| ) |
Drop parts with UNMOUNT_ON_MOVE onto the ground.
| shed_cables | If cable parts should also be dropped. |
| - | If set to trinary::NONE, the default, don't drop any cables. |
| - | If set to trinary::SOME, calculate cable length, updating remote parts, and drop if it's too long. |
| - | If set to trinary::ALL, drop all cables. |
| dst | Future vehicle position, used for calculating cable length when shed_cables == trinary::SOME. |
Definition at line 6976 of file vehicle.cpp.
References _, map::add_item_or_charges(), add_msg_if_player_sees(), ALL, bub_part_pos(), vehicle_part::get_base(), get_map(), get_remote_part(), map::getabs(), global_part_pos3(), vpart_info::has_flag(), vehicle_part::info(), loose_parts, m_warning, magic, item::max_link_length(), vehicle_part::name(), name, NONE, part(), part_to_item(), pos_bub(), vehicle_part::precalc, remove_part(), remove_remote_part(), rl_dist(), vehicle_part::target, and VPFLAG_POWER_TRANSFER.
Referenced by map::displace_vehicle(), and gain_moves().
| bool vehicle::shift_if_needed | ( | map & | here | ) |
Detect if the vehicle is currently missing a 0,0 part, and adjust if necessary.
Definition at line 7283 of file vehicle.cpp.
References get_all_parts(), parts, parts_at_relative(), point_zero, refresh(), and shift_parts().
Referenced by merge_appliance_into_grid(), part_removal_cleanup(), remove_part(), and separate_from_grid().
Shifts all parts of the vehicle by the given amounts, and then shifts the vehicle itself in the opposite direction.
The end result is that the vehicle appears to have not moved. Useful for re-zeroing a vehicle to ensure that a (0, 0) part is always present.
| delta | How much to shift along each axis |
Definition at line 7252 of file vehicle.cpp.
References active_items, anonymous_namespace{item_tname.cpp}::label(), labels, loot_zones, parts, pivot_anchor, map::rebuild_vehicle_level_caches(), refresh(), and active_item_cache::subtract_locations().
Referenced by find_and_split_vehicles(), shift_if_needed(), and split_vehicles().
|
private |
Definition at line 2289 of file vehicle_move.cpp.
References abs(), tripoint::x, and tripoint::y.
Referenced by update_active_fakes().
| void vehicle::slow_leak | ( | ) |
Definition at line 5750 of file vehicle.cpp.
References map::add_item_or_charges(), vehicle_part::ammo_consume(), vehicle_part::ammo_current(), vehicle_part::ammo_remaining(), coord_translate(), fuel_containers, fuel_type_battery, fuel_type_plutonium_cell, get_map(), global_part_pos3(), global_pos3(), health, vehicle_part::health_percent(), vehicle_part::is_leaking(), max(), vehicle_part::mount, part(), parts, PLUTONIUM_CHARGES, tripoint, and calendar::turn.
Referenced by map::vehmove().
| int vehicle::slowdown | ( | int | velocity | ) | const |
Definition at line 107 of file vehicle_move.cpp.
References abs(), add_msg_debug, can_float(), coeff_air_drag(), coeff_rolling_drag(), coeff_water_drag(), debugmsg, debugmode::DF_VEHICLE_MOVE, tileray::dir(), face, towing_data::get_towed(), is_falling, is_flying, is_towing(), is_watercraft(), max(), move, mps_to_vmiph(), name, vehicles::rolling_constant_to_variable, units::sin(), slowdown(), static_drag(), units::to_kilogram(), units::to_watt(), total_mass(), tow_data, units::quantity< V, U >::value(), and vmiph_to_mps().
Referenced by gain_moves(), and slowdown().
| void vehicle::smart_controller_handle_turn | ( | const std::optional< float > & | k_traction_cache = std::nullopt | ) |
if smart controller is enabled, turns on and off engines depending on load and battery level
| thrusting | must be true when called from vehicle::thrust and vehicle is thrusting |
| k_traction_cache | cached value of vehicle::k_traction, if empty, will be computed |
Definition at line 146 of file vehicle_move.cpp.
References _, abs(), add_msg(), add_msg_debug, alternator_load, autopilot_on, avg_velocity, smart_controller_config::battery_hi, smart_controller_config::battery_lo, battery_power_level(), clamp(), cruise_velocity, current_acceleration(), debugmode::DF_VEHICLE_MOVE, sfx::do_vehicle_engine_sfx(), vehicle_part::enabled, engine_fuel_left(), engine_fuel_usage(), engine_on, engines, units::from_watt(), fuel_type_battery, fuel_usage(), get_avail_parts(), get_map(), get_player_character(), has_enabled_smart_controller, vehicle_part::is_available(), is_engine_on(), is_engine_type(), is_engine_type_combustion(), is_flying, is_rotorcraft(), k_traction(), m_bad, max(), min(), net_battery_charge_rate(), parts, player_in_control(), safe_ground_velocity(), smart_controller_cfg, smart_controller_state, start_engine(), stop_engines(), calendar::turn, update_alternator_load(), and velocity.
| void vehicle::smash | ( | map & | m, |
| float | hp_percent_loss_min = 0.1f, |
||
| float | hp_percent_loss_max = 1.2f, |
||
| float | percent_of_parts_to_affect = 1.0f, |
||
| point | damage_origin = point_zero, |
||
| float | damage_size = 0 |
||
| ) |
Smashes up a vehicle that has already been placed; used for generating very damaged vehicles.
Additionally, any spot where two vehicles overlapped (i.e., any spot with multiple frames) will be completely destroyed, as that was the collision point.
Definition at line 863 of file vehicle.cpp.
References vehicle_part::ammo_unset(), clamp(), dice(), vpart_info::durability, g, get_map(), vehicle_part::hp(), vpart_info::id, vehicle_part::info(), vehicle_part::is_broken(), vehicle_part::is_fake, vpart_info::location, mod_hp(), vehicle_part::mount, part(), part_location_structure(), parts, parts_at_relative(), vehicle_part::precalc, remove_part(), vehicle_part::removed, rng_float(), and trig_dist().
Referenced by map::add_vehicle_to_map(), init_state(), MapExtras::mx_helicopter(), and monster::shove_vehicle().
|
private |
Definition at line 438 of file vehicle_use.cpp.
References _, add_msg(), Character::controlling_vehicle, damage_direct(), debugmsg, vpart_info::durability, get_map(), get_player_character(), Character::get_skill_level(), vpart_info::has_flag(), vehicle_part::info(), is_alarm_on, vehicle_part::is_broken(), vehicle_part::mount, part(), part_with_feature(), rand(), vehicle_part::removed, rng(), skill_mechanics, and speciality.
Referenced by build_interact_menu().
| void vehicle::spew_field | ( | double | joules, |
| int | part, | ||
| field_type_id | type, | ||
| int | intensity = 1 |
||
| ) | const |
Definition at line 4003 of file vehicle.cpp.
References exhaust_dest(), get_map(), intensity, max(), map::mod_field_intensity(), part(), rng(), and type.
Referenced by noise_and_smoke().
| bool vehicle::split_vehicles | ( | map & | here, |
| const std::vector< std::vector< int >> & | new_vehs, | ||
| const std::vector< vehicle * > & | new_vehicles, | ||
| const std::vector< std::vector< point >> & | new_mounts, | ||
| std::vector< vehicle * > * | added_vehicles = nullptr |
||
| ) |
Definition at line 2375 of file vehicle.cpp.
References add_tag(), map::add_vehicle(), camera_on, character_id, towing_data::clear_towing(), zone_manager::create_vehicle_loot_zone(), cruise_velocity, tileray::dir(), map::dirty_vehicle_list, engine_on, face, flag_APPLIANCE(), flag_WIRING(), zone_manager::get_manager(), get_passenger(), towing_data::get_towed(), towing_data::get_towed_by(), global_part_pos3(), vpart_info::has_flag(), vehicle_part::info(), is_appliance(), is_powergrid(), is_towed(), is_towing(), itype_wall_wiring, anonymous_namespace{item_tname.cpp}::label(), labels, vpart_info::location, loot_zones, vehicle_part::mount, move, name, old_owner, owner, part(), part_location_structure(), parts, passenger_flag, vehicle_part::passenger_id, pivot_point(), point_zero, precalc_mounts(), refresh(), relocate_passengers(), vehicle_part::remove_flag(), vehicle_part::removed, map::set_seen_cache_dirty(), towing_data::set_towing(), map::set_transparency_cache_dirty(), shift_parts(), skidding, sm_pos, tow_data, tracking_on, tripoint_zero, turn_dir, vehicle_prototype_none, velocity, vertical_velocity, VPFLAG_BOARDABLE, tripoint::z, and zones_dirty.
Referenced by find_and_split_vehicles(), remove_carried_vehicle(), and separate_from_grid().
| bool vehicle::start_engine | ( | vehicle_part & | vp | ) |
Definition at line 629 of file vehicle_use.cpp.
References _, add_msg(), sounds::alarm, auto_select_fuel(), backfire(), vehicle_part::damage_percent(), discharge_battery(), engine_cold_factor(), vpart_info::engine_info, engine_start_time(), fault_engine_starter, vehicle_part::faults_potential(), vpart_info::fuel_type, fuel_type_battery, fuel_type_muscle, fuel_type_wind, get_player_character(), Character::get_size(), Character::get_working_leg_count(), global_part_pos3(), vehicle_part::has_fault_flag(), vpart_info::has_flag(), has_part(), Character::has_two_arms_lifting(), sfx::has_variant_sound(), vpart_info::id, vehicle_part::info(), is_engine_on(), is_engine_type(), sounds::movement, vehicle_part::name(), item::nname(), one_in(), part_epower(), sfx::play_variant_sound(), Creature::pos(), pos, power_to_energy_bat(), small, sounds::sound(), string_id< T >::str(), string_format(), tiny, and x_in_y().
Referenced by smart_controller_handle_turn(), start_engine(), and activity_handlers::start_engines_finish().
| bool vehicle::start_engine | ( | vehicle_part & | vp, |
| bool | turn_on | ||
| ) |
| void vehicle::start_engines | ( | bool | take_control = false, |
| bool | autodrive = false |
||
| ) |
Definition at line 778 of file vehicle_use.cpp.
References _, ACT_START_ENGINES, Character::activity, add_msg(), Character::assign_activity(), bub_part_pos(), Character::controlling_vehicle, vehicle_part::enabled, engine_start_time(), engines, get_player_character(), vehicle_part::is_broken(), is_engine_on(), m_info, max(), name, parts, Creature::pos_bub(), refresh(), player_activity::relative_placement, and player_activity::values.
Referenced by build_interact_menu(), control_engines(), game::control_vehicle(), enable_patrol(), iuse::remoteveh(), and toggle_autopilot().
| units::power vehicle::static_drag | ( | bool | actual = true | ) | const |
Definition at line 4584 of file vehicle.cpp.
References engine_on, extra_drag, get_map(), get_tow_part(), towing_data::get_towed_by(), map::getabs(), global_part_pos3(), is_towed(), rl_dist(), and tow_data.
Referenced by veh_interact::display_stats(), and slowdown().
| float vehicle::steering_effectiveness | ( | ) | const |
Definition at line 4769 of file vehicle.cpp.
References can_float(), vpart_info::fuel_type, fuel_type_animal, get_harnessed_animal(), in_deep_water, vehicle_part::info(), vehicle_part::is_available(), is_flying, is_rotorcraft(), is_watercraft(), parts, and steering.
Referenced by handling_difficulty(), pldrive(), selfdrive(), and wheel_state_description().
| void vehicle::stop | ( | ) |
Definition at line 682 of file vehicle_move.cpp.
References face, get_map(), get_points(), map::inbounds(), last_turn, map::memory_cache_dec_set_dirty(), move, of_turn_carry, skidding, and velocity.
Referenced by act_on_map(), consume_fuel(), map::displace_vehicle(), drive_to_local_target(), gain_moves(), handbrake(), map::move_vehicle(), precollision_check(), and thrust().
| void vehicle::stop_autodriving | ( | bool | apply_brakes = true | ) |
Definition at line 1432 of file vehicle_autodrive.cpp.
References active_autodrive_controller, autodrive_local_target, autopilot_on, collision_check_points, cruise_velocity, is_autodriving, is_following, is_patrolling, and tripoint_zero.
Referenced by autodrive_activity_actor::canceled(), damage_direct(), do_autodrive(), drive_to_local_target(), autodrive_activity_actor::finish(), map::move_vehicle(), part_collision(), and map::unboard_vehicle().
| void vehicle::stop_engines | ( | ) |
Definition at line 746 of file vehicle_use.cpp.
References _, sfx::do_vehicle_engine_sfx(), vpart_info::engine_info, engine_on, engines, fuel_type_battery, fuel_type_muscle, fuel_type_wind, global_part_pos3(), sfx::has_variant_sound(), vpart_info::id, vehicle_part::info(), is_engine_on(), is_engine_type(), sounds::movement, parts, sfx::play_variant_sound(), refresh(), sounds::sound(), string_id< T >::str(), and vehicle_noise.
Referenced by build_interact_menu(), smart_controller_handle_turn(), and toggle_autopilot().
| float vehicle::strain | ( | ) | const |
Definition at line 4612 of file vehicle.cpp.
References abs(), max_velocity(), safe_velocity(), and velocity.
Referenced by consume_fuel(), do_engine_damage(), print_speed_gauge(), thrust(), and display::vehicle_cruise_text_color().
| bool vehicle::sufficient_wheel_config | ( | ) | const |
Definition at line 4629 of file vehicle.cpp.
References all_parts_at_location(), part(), part_location_structure(), om_direction::size, and wheelcache.
Referenced by valid_wheel_config(), wait(), and wheel_state_description().
| void vehicle::suspend_refresh | ( | ) |
Disable or enable refresh() ; used to speed up performance when creating a vehicle.
Definition at line 6135 of file vehicle.cpp.
References coeff_air_changed, coeff_air_dirty, coeff_rolling_dirty, coeff_water_dirty, mass_center_no_precalc_dirty, mass_center_precalc_dirty, mass_dirty, and no_refresh.
Referenced by vehicles::finalize_prototypes().
| void vehicle::thrust | ( | int | thd, |
| int | z = 0 |
||
| ) |
Definition at line 448 of file vehicle_move.cpp.
References _, abs(), add_msg(), alternator_load, can_float(), consume_fuel(), cruise_velocity, current_acceleration(), damage_direct(), tileray::dir(), do_engine_damage(), effect_harnessed, engine_on, engines, face, vpart_info::fuel_type, fuel_type_animal, fuel_type_battery, fuel_type_muscle, get_map(), get_monster(), monster::get_name(), get_player_character(), Creature::get_speed(), towing_data::get_towed(), Creature::has_effect(), has_engine_type(), in_deep_water, vehicle_part::info(), is_flying, is_flying_in_air(), is_moving(), is_rotorcraft(), is_towing(), is_watercraft(), k_traction(), ammo_effects::load(), m_bad, m_info, max(), max_reverse_velocity(), max_velocity(), min(), n_gettext, name, noise_and_smoke(), parts, player_in_control(), requested_z_change, rng(), sgn(), skidding, smart_controller_handle_turn(), stop(), strain(), total_power(), tow_data, turn_dir, valid_wheel_config(), and velocity.
Referenced by gain_moves(), pldrive(), and selfdrive().
| void vehicle::toggle_autopilot | ( | ) |
Definition at line 495 of file vehicle_use.cpp.
References _, veh_menu::add(), add_msg(), autodrive_local_target, autopilot_on, autopilot_patrol_check(), veh_menu_item::desc(), engine_on, veh_menu_item::hotkey(), is_following, is_patrolling, veh_menu_item::on_submit(), precollision_on, veh_menu::query(), start_engines(), stop_engines(), and tripoint_zero.
Referenced by build_interact_menu().
| void vehicle::toggle_tracking | ( | ) |
Definition at line 543 of file vehicle_use.cpp.
References _, add_msg(), overmapbuffer::add_vehicle(), overmap_buffer, overmapbuffer::remove_vehicle(), and tracking_on.
Referenced by build_interact_menu(), game::place_vehicle_nearby(), remove_carried_vehicle(), and vehicle_unfolding_activity_actor::unfold_vehicle().
if tool is not an itype with tool != nullptr this returns { itype::NULL_ID(), 0 } pair
| tool | the item to examine |
Definition at line 1724 of file vehicle_use.cpp.
References itype::ammo, ammo_battery, battery_left(), fuel_left(), string_id< T >::is_null(), max(), string_id< itype >::NULL_ID(), itype::tool, and itype::tool_slot_first_ammo().
Referenced by prepare_tool(), and use_vehicle_tool().
| units::power vehicle::total_accessory_epower | ( | ) | const |
Definition at line 4998 of file vehicle.cpp.
References accessories, vehicle_part::enabled, vpart_info::epower, vehicle_part::info(), part(), and parts.
Referenced by veh_app_interact::draw_info(), net_battery_charge_rate(), and power_parts().
| units::power vehicle::total_alternator_epower | ( | ) | const |
Definition at line 5063 of file vehicle.cpp.
References alternators, engine_on, is_alternator_on(), part_epower(), and parts.
Referenced by veh_app_interact::draw_info(), net_battery_charge_rate(), and power_parts().
| units::power vehicle::total_engine_epower | ( | ) | const |
Definition at line 5078 of file vehicle.cpp.
References engine_on, engines, is_engine_on(), part_epower(), and parts.
Referenced by net_battery_charge_rate(), and power_parts().
| units::mass vehicle::total_mass | ( | ) | const |
Definition at line 3472 of file vehicle.cpp.
References calc_mass_center(), mass_cache, and mass_dirty.
Referenced by coeff_rolling_drag(), coeff_water_drag(), veh_interact::display_stats(), get_folded_item(), game::grabbed_veh_move(), ground_acceleration(), has_sufficient_rotorlift(), jack_quality(), k_traction(), lift_strength(), map::move_vehicle(), part_collision(), Character::pause(), rotor_acceleration(), monster::shove_vehicle(), slowdown(), map::vehicle_vehicle_collision(), and water_acceleration().
| units::power vehicle::total_power | ( | bool | fueled = true, |
| bool | safe = false |
||
| ) | const |
Definition at line 3697 of file vehicle.cpp.
References alternators, engine_fuel_left(), vpart_info::engine_info, engines, vehicle_part::has_fault_flag(), vehicle_part::info(), is_alternator_on(), is_engine_on(), max(), part_vpower_w(), parts, and iexamine::safe().
Referenced by veh_interact::calc_overview(), crash_terrain_around(), ground_acceleration(), idle(), lift_thrust_of_rotorcraft(), max_ground_velocity(), max_water_velocity(), safe_ground_velocity(), safe_water_velocity(), thrust(), and water_acceleration().
| units::power vehicle::total_solar_epower | ( | ) | const |
Definition at line 5096 of file vehicle.cpp.
References current_weather(), get_map(), map::getabs(), global_part_pos3(), global_square_location(), incident_sun_irradiance(), intensity, is_sm_tile_outside(), vehicle_part::is_unavailable(), max_sun_irradiance(), part_epower(), parts, pos, solar_panels, and calendar::turn.
Referenced by veh_app_interact::draw_info(), and net_battery_charge_rate().
| units::power vehicle::total_water_wheel_epower | ( | ) | const |
Definition at line 5140 of file vehicle.cpp.
References get_map(), map::getabs(), global_part_pos3(), is_sm_tile_over_water(), vehicle_part::is_unavailable(), part_epower(), parts, pos, and water_wheels.
Referenced by veh_app_interact::draw_info(), net_battery_charge_rate(), and update_time().
| units::power vehicle::total_wind_epower | ( | ) | const |
Definition at line 5116 of file vehicle.cpp.
References get_local_windpower(), get_map(), get_weather(), map::getabs(), map::getglobal(), global_omt_location(), global_part_pos3(), is_sm_tile_outside(), vehicle_part::is_unavailable(), overmap_buffer, part_epower(), parts, pos, overmapbuffer::ter(), and wind_turbines.
Referenced by veh_app_interact::draw_info(), net_battery_charge_rate(), and update_time().
| bool vehicle::tow_cable_too_far | ( | ) | const |
Definition at line 6886 of file vehicle.cpp.
References debugmsg, disp_name(), get_map(), get_tow_part(), towing_data::get_towed(), towing_data::get_towed_by(), map::getabs(), global_part_pos3(), rl_dist(), tow_data, and tripoint_zero.
Referenced by map::move_vehicle().
| void vehicle::transform_terrain | ( | ) |
Definition at line 992 of file vehicle_use.cpp.
References _, abs(), map::add_field(), sounds::combat, damage(), damage_bash, field_type_id, furn_id, map::furn_set(), get_enabled_parts(), get_map(), map::has_flag(), string_id< furn_t >::NULL_ID(), string_id< ter_t >::NULL_ID(), vpslot_terrain_transform::post_field, vpslot_terrain_transform::post_field_age, vpslot_terrain_transform::post_field_intensity, vpslot_terrain_transform::post_furniture, vpslot_terrain_transform::post_terrain, vpslot_terrain_transform::pre_flags, rng(), sounds::sound(), speed, ter_id, map::ter_set(), and velocity.
Referenced by on_move().
| void vehicle::turn | ( | units::angle | deg | ) |
Definition at line 668 of file vehicle_move.cpp.
References last_turn, normalize(), round_to_multiple_of(), vehicles::steer_increment, turn_dir, and velocity.
Referenced by act_on_map(), game::grabbed_veh_move(), handbrake(), map::move_vehicle(), MapExtras::mx_helicopter(), part_collision(), pldrive(), restore_folded_parts(), and selfdrive().
| turret_data vehicle::turret_query | ( | const tripoint & | pos | ) |
| turret_data vehicle::turret_query | ( | vehicle_part & | pt | ) |
Get firing data for a turret.
Definition at line 60 of file turret.cpp.
References vehicle_part::is_broken(), vehicle_part::is_turret(), and vehicle_part::removed.
Referenced by automatic_fire_turret(), build_interact_menu(), find_all_ready_turrets(), idle(), turret_data::in_range(), target_handler::mode_turrets(), turret_query(), turrets_aim(), turrets_aim_and_fire(), turrets_aim_and_fire_single(), and target_ui::update_turrets_in_range().
| std::vector< vehicle_part * > vehicle::turrets | ( | ) |
Get all vehicle turrets (excluding any that are destroyed)
Definition at line 36 of file turret.cpp.
References vehicle_part::is_broken(), vehicle_part::is_turret(), parts, and turret_locations.
Referenced by find_all_ready_turrets(), gain_moves(), idle(), turrets(), turrets_aim(), turrets_aim_and_fire(), turrets_aim_and_fire_all_manual(), turrets_aim_and_fire_single(), turrets_override_automatic_aim(), turrets_set_mode(), and turrets_set_targeting().
| std::vector< vehicle_part * > vehicle::turrets | ( | const tripoint & | target | ) |
Get all vehicle turrets loaded and ready to fire at target.
Definition at line 49 of file turret.cpp.
References turrets().
|
private |
Definition at line 401 of file turret.cpp.
References _, Character::add_msg_if_player(), debugmsg, get_avatar(), Creature::get_moves(), global_part_pos3(), Character::has_trait(), turret_data::in_range(), Character::int_cur, min(), target_handler::mode_turrets(), Creature::set_moves(), trait_BRAWLER, turret_query(), and turrets().
Referenced by turrets_aim_and_fire(), and turrets_override_automatic_aim().
|
private |
Definition at line 384 of file turret.cpp.
References turret_data::fire(), global_part_pos3(), turret_query(), turrets(), and turrets_aim().
Referenced by turrets_aim_and_fire_all_manual(), and turrets_aim_and_fire_single().
| bool vehicle::turrets_aim_and_fire_all_manual | ( | bool | show_msg = false | ) |
Definition at line 355 of file turret.cpp.
References _, add_msg(), find_all_ready_turrets(), m_warning, turrets(), and turrets_aim_and_fire().
Referenced by build_interact_menu().
| void vehicle::turrets_aim_and_fire_single | ( | ) |
Select a single ready turret, aim it using the aiming UI and fire.
Definition at line 325 of file turret.cpp.
References _, add_msg(), cata_path::empty(), m_warning, PATH_INFO::options(), turret_data::query(), turret_data::ready, turret_query(), turrets(), and turrets_aim_and_fire().
Referenced by build_interact_menu().
| void vehicle::turrets_override_automatic_aim | ( | ) |
Set target for automatic turrets using the aiming UI.
Definition at line 371 of file turret.cpp.
References _, add_msg(), find_all_ready_turrets(), m_warning, turrets(), and turrets_aim().
Referenced by build_interact_menu().
| void vehicle::turrets_set_mode | ( | ) |
Set firing mode for specific turrets.
Definition at line 509 of file turret.cpp.
References _, uilist::addentry(), uilist::callback, uilist::fselected, global_part_pos3(), anonymous_namespace{overmap_location.cpp}::locations, MENU_AUTOASSIGN, parts, uilist::query(), uilist::ret, uilist::selected, uilist::text, turrets(), and uilist::w_y_setup.
Referenced by build_interact_menu().
| void vehicle::turrets_set_targeting | ( | ) |
Set targeting mode for specific turrets.
Definition at line 453 of file turret.cpp.
References _, uilist::addentry(), uilist::callback, vehicle_part::enabled, uilist::fselected, get_avail_parts(), global_part_pos3(), has_part(), anonymous_namespace{overmap_location.cpp}::locations, MENU_AUTOASSIGN, vehicle_part::mount, parts, pos, uilist::query(), uilist::ret, uilist::selected, uilist::text, turrets(), and uilist::w_y_setup.
Referenced by build_interact_menu().
| void vehicle::unboard_all | ( | ) | const |
Definition at line 7134 of file vehicle.cpp.
References boarded_parts(), bp, get_map(), global_part_pos3(), and map::unboard_vehicle().
Referenced by act_on_map(), and vehicle_folding_activity_actor::fold_vehicle().
| time_duration vehicle::unfolding_time | ( | ) | const |
Definition at line 7616 of file vehicle.cpp.
References generic_vehicle_part_range< range_type >::begin(), generic_vehicle_part_range< range_type >::end(), get_all_parts(), vpart_info::get_unfolding_time(), vehicle_part::info(), and part().
Referenced by get_folded_item().
| void vehicle::unlink_cables | ( | const point & | mount, |
| Character & | remover, | ||
| bool | unlink_items = false, |
||
| bool | unlink_tow_cables = false, |
||
| bool | unlink_power_cords = false |
||
| ) |
Disconnect cables attached to the specified mount point.
| mount | The mount point to detach cables from. |
| remover | The character disconnecting the cables. |
| unlink_items | If extension cord and device items should be unlinked. |
| unlink_tow_cables | If tow cables should be unlinked. |
| unlink_power_cords | If power grid cables (power_cord) should be unlinked. |
Definition at line 7025 of file vehicle.cpp.
References _, Character::add_msg_if_player(), Character::can_stash(), flag_NO_DROP, vehicle_part::get_base(), item::has_flag(), vpart_info::has_flag(), vehicle_part::has_flag(), Character::i_add_or_drop(), vehicle_part::info(), invalidate_towing(), vehicle_part::last_disconnected, linked_flag, linked_item_epower_this_turn, magic, vehicle_part::name(), part(), part_to_item(), parts, parts_at_relative(), vehicle_part::remove_flag(), remove_part(), remove_remote_part(), calendar::turn, item::type_name(), and VPFLAG_POWER_TRANSFER.
Referenced by build_interact_menu(), veh_interact::complete_vehicle(), and separate_from_grid().
| void vehicle::unlock | ( | ) |
Definition at line 1051 of file vehicle.cpp.
References fault_engine_immobiliser, is_locked, and parts.
Referenced by open_or_close().
| void vehicle::unlock | ( | int | part_index | ) |
Unlocks a lockable, closed part at the specified index.
If it's a multipart, unlocks all attached parts as well. Does not affect vehicle is_locked flag.
| part_index | The index in the parts list of the part to unlock. |
Definition at line 1225 of file vehicle_use.cpp.
References debugmsg, vpart_info::has_flag(), vehicle_part::info(), lock_or_unlock(), vehicle_part::name(), name, and part().
Referenced by game::place_vehicle_nearby(), and doors::unlock_door().
| void vehicle::update_active_fakes | ( | ) |
Definition at line 2300 of file vehicle_move.cpp.
References vpart_edge_info::back, edges, vehicle_part::fake_part_to, fake_parts, vehicle_part::fake_protrusion_on, vpart_edge_info::forward, vpart_info::has_flag(), vehicle_part::info(), vehicle_part::is_active_fake, vehicle_part::mount, parts, vehicle_part::precalc, vehicle_part::removed, and should_enable_fake().
Referenced by map::displace_vehicle(), and refresh().
| void vehicle::update_alternator_load | ( | ) |
Definition at line 5205 of file vehicle.cpp.
References abs(), alternator_load, alternators, engine_on, engines, extra_drag, vpart_info::has_flag(), vehicle_part::info(), is_alternator_on(), is_engine_on(), part_vpower_w(), and parts.
Referenced by power_parts(), and smart_controller_handle_turn().
| void vehicle::update_time | ( | const time_point & | update_to | ) |
Definition at line 7876 of file vehicle.cpp.
References add_msg_debug, vpart_info::bonus, charge_battery(), itype::charges_to_use(), debugmode::DF_VEHICLE, discharge_battery(), fuel_left(), funnel_charges_per_turn(), funnels, get_map(), map::getabs(), global_part_pos3(), global_square_location(), vehicle_part::info(), intensity, invalidate_mass(), is_sm_tile_outside(), vehicle_part::is_unavailable(), itype_battery, itype_water, itype_water_clean, itype_water_purifier, last_update, M_PI, max_sun_irradiance(), name, part_epower(), vpart_position::part_with_tool(), parts, pos, power_to_energy_bat(), weather_sum::radiant_exposure, weather_sum::rain_amount, roll_remainder(), sm_pos, solar_panels, sum_conditions(), total_water_wheel_epower(), total_wind_epower(), water, water_wheels, wind_turbines, and tripoint::z.
Referenced by idle().
| void vehicle::use_autoclave | ( | int | p | ) |
Definition at line 1370 of file vehicle_use.cpp.
References _, add_msg(), item_stack::begin(), drain(), item_stack::empty(), vehicle_part::enabled, item_stack::end(), fuel_left(), get_items(), itype_water, itype_water_clean, m_bad, m_good, name, and parts.
| std::list< item > vehicle::use_charges | ( | const vpart_position & | vp, |
| const itype_id & | type, | ||
| int & | quantity, | ||
| const std::function< bool(const item &)> & | filter, | ||
| bool | in_tools = false |
||
| ) |
Consumes specified charges (or fewer) from the vehicle part.
| what | specific type of charge required, e.g. 'battery' |
| qty | maximum charges to consume. On return set to number of charges not found (or zero) |
| filter | Must return true for use to occur. |
Definition at line 7743 of file vehicle.cpp.
References add_msg_debug, vpart_position::cargo(), item::charges, debugmode::DF_VEHICLE, filter, string_id< T >::is_null(), itype_water_faucet, string_id< T >::obj(), vpart_position::part_with_tool(), vpart_position::pos(), cata::hash64_detail::ret, SOLID, string_id< T >::str(), calendar::turn_zero, and type.
| void vehicle::use_dishwasher | ( | int | p | ) |
Definition at line 1502 of file vehicle_use.cpp.
References _, add_msg(), item_stack::begin(), Character::consume_items(), Character::crafting_inventory(), drain(), item_stack::empty(), vehicle_part::enabled, item_stack::end(), fuel_left(), get_avatar(), get_items(), read_only_visitable::has_charges(), is_crafting_component(), itype_detergent, itype_water, itype_water_clean, m_bad, m_good, name, and parts.
| void vehicle::use_harness | ( | int | part, |
| const tripoint & | pos | ||
| ) |
Definition at line 1575 of file vehicle_use.cpp.
References _, Creature::add_effect(), add_msg(), mtype::bodytype, choose_adjacent_highlight(), creature_tracker::creature_at(), debugmsg, disp_name(), effect_harnessed, effect_tied, monster::friendly, g, get_creature_tracker(), monster::get_name(), get_player_character(), Creature::has_effect(), monster::has_flag(), vpart_info::has_flag(), Character::i_add(), vehicle_part::info(), vehicle_part::is_unavailable(), m_info, mon_flag_PET_HARNESSABLE, mon_flag_PET_MOUNTABLE, part(), parts, pos, Creature::remove_effect(), vehicle_part::removed, Creature::setpos(), monster::tied_item, and monster::type.
| void vehicle::use_monster_capture | ( | int | part, |
| const tripoint & | pos | ||
| ) |
Definition at line 1559 of file vehicle_use.cpp.
References animal_flag, get_avatar(), item::has_var(), invalidate_mass(), itype::invoke(), item, part(), parts, pos, and item::type.
|
static |
Definition at line 1781 of file vehicle_use.cpp.
References act, ACT_REPAIR_ITEM, Character::activity, ammo_battery, item::ammo_current(), item::ammo_remaining(), item::ammo_required(), discharge_battery(), drain(), get_player_character(), string_id< T >::id(), Character::invoke_item(), itype_large_repairkit, itype_small_repairkit, itype_soldering_iron, itype_welder, itype_welder_crude, itype_welding_kit, prepare_tool(), string_id< T >::str(), tool_ammo_available(), and calendar::turn.
Referenced by hacksaw_activity_actor::do_turn().
| void vehicle::use_washing_machine | ( | int | p | ) |
Definition at line 1418 of file vehicle_use.cpp.
References _, add_msg(), uilist::addentry(), item_stack::begin(), Character::consume_items(), Character::crafting_inventory(), drain(), item_stack::empty(), vehicle_part::enabled, item_stack::end(), flag_id, fuel_left(), get_avatar(), get_items(), read_only_visitable::has_charges(), item::has_flag(), is_crafting_component(), visitable::items_with(), itype_water, itype_water_clean, m_bad, m_good, name, item::nname(), parts, uilist::query(), uilist::ret, STATIC, uilist::text, item::typeId(), and UILIST_CANCEL.
| bool vehicle::valid_wheel_config | ( | ) | const |
Definition at line 4764 of file vehicle.cpp.
References balanced_wheel_config(), and sufficient_wheel_config().
Referenced by overmap_ui::get_overmap_path_to(), game::grabbed_veh_move(), init_state(), map::move_vehicle(), pldrive(), refresh_pivot(), selfdrive(), and thrust().
| rl_vec2d vehicle::velo_vec | ( | ) | const |
Definition at line 1588 of file vehicle_move.cpp.
References face_vec(), move_vec(), cata::hash64_detail::ret, skidding, and velocity.
Referenced by map::vehicle_vehicle_collision().
| int vehicle::water_acceleration | ( | bool | fueled = true, |
| int | at_vel_in_vmi = -1 |
||
| ) | const |
Definition at line 3783 of file vehicle.cpp.
References add_msg_debug, cmps_to_vmiph(), debugmode::DF_VEHICLE, engine_on, towing_data::get_towed(), is_towing(), max(), max_water_velocity(), name, skidding, units::to_kilogram(), units::to_watt(), total_mass(), total_power(), tow_data, and vmiph_to_cmps().
Referenced by acceleration(), and veh_interact::display_stats().
| double vehicle::water_draft | ( | ) | const |
water draft in meters - how much of the vehicle's body is under water must be less than the hull height or the boat will sink at some point, also add boats with deep draft running around
Definition at line 4341 of file vehicle.cpp.
References coeff_water_dirty, coeff_water_drag(), and draft_m.
Referenced by veh_interact::display_stats().
| double vehicle::water_hull_height | ( | ) | const |
watertight hull height in meters measures distance from bottom of vehicle to the point where the vehicle will start taking on water
Definition at line 4333 of file vehicle.cpp.
References coeff_water_dirty, coeff_water_drag(), and hull_height.
Referenced by veh_interact::display_stats().
| int vehicle::wheel_area | ( | ) | const |
Calculates the sum of the area under the wheels of the vehicle.
Definition at line 4105 of file vehicle.cpp.
References parts, and wheelcache.
Referenced by veh_interact::display_stats(), overmap_ui::get_overmap_path_to(), and k_traction().
| bool vehicle::would_install_prevent_flyable | ( | const vpart_info & | vpinfo, |
| const Character & | pc | ||
| ) | const |
Definition at line 4412 of file vehicle.cpp.
References flyable, vpart_info::has_flag(), Character::has_proficiency(), proficiency_prof_aircraft_mechanic, and rotors.
Referenced by veh_interact::do_install().
| bool vehicle::would_removal_prevent_flyable | ( | const vehicle_part & | vp, |
| const Character & | pc | ||
| ) | const |
Definition at line 4438 of file vehicle.cpp.
References flyable, vpart_info::has_flag(), Character::has_proficiency(), vehicle_part::info(), proficiency_prof_aircraft_mechanic, and rotors.
Referenced by can_do_activity_there(), and veh_interact::do_remove().
| bool vehicle::would_repair_prevent_flyable | ( | const vehicle_part & | vp, |
| const Character & | pc | ||
| ) | const |
Definition at line 4422 of file vehicle.cpp.
References flyable, vpart_info::has_flag(), Character::has_proficiency(), index_of_part(), vehicle_part::info(), vpart_position::is_inside(), proficiency_prof_aircraft_mechanic, and rotors.
Referenced by can_do_activity_there(), veh_interact::do_repair(), and veh_utils::most_repairable_part().
| std::vector<int> vehicle::accessories |
Definition at line 2195 of file vehicle.h.
Referenced by veh_app_interact::draw_info(), veh_app_interact::init_ui_windows(), refresh(), and total_accessory_epower().
|
private |
Definition at line 2246 of file vehicle.h.
Referenced by do_autodrive(), get_debug_overlay_data(), and stop_autodriving().
| active_item_cache vehicle::active_items |
Definition at line 2217 of file vehicle.h.
Referenced by add_item(), make_active(), map::process_items_in_vehicle(), refresh_active_item_cache(), and shift_parts().
| bool vehicle::all_wheels_on_one_axis = false |
Definition at line 2350 of file vehicle.h.
Referenced by is_wheel_state_correct_to_turn_on_rails(), and refresh().
| int vehicle::alternator_load = 0 |
Definition at line 2264 of file vehicle.h.
Referenced by idle(), refresh(), smart_controller_handle_turn(), thrust(), and update_alternator_load().
| std::vector<int> vehicle::alternators |
Definition at line 2172 of file vehicle.h.
Referenced by veh_app_interact::draw_info(), veh_app_interact::init_ui_windows(), is_powergrid(), refresh(), total_alternator_epower(), total_power(), and update_alternator_load().
|
private |
Definition at line 2233 of file vehicle.h.
Referenced by get_safe_reference().
|
private |
Definition at line 2244 of file vehicle.h.
Referenced by autopilot_patrol(), enable_patrol(), get_debug_overlay_data(), stop_autodriving(), and toggle_autopilot().
| bool vehicle::autopilot_on = false |
Definition at line 2360 of file vehicle.h.
Referenced by game::control_vehicle(), cruise_thrust(), drive_to_local_target(), enable_patrol(), smart_controller_handle_turn(), stop_autodriving(), and toggle_autopilot().
| int vehicle::avg_velocity = 0 |
vehicle continuous moving average velocity see https://en.wikipedia.org/wiki/Moving_average#Exponential_moving_average alpha is 0.5: avg_velocity = avg_velocity + 0.5(velocity - avg_velocity) = 0.5 avg_velocity + 0.5 velocity
Definition at line 2282 of file vehicle.h.
Referenced by idle(), and smart_controller_handle_turn().
| std::vector<int> vehicle::batteries |
Definition at line 2190 of file vehicle.h.
Referenced by battery_left(), battery_power_level(), charge_battery(), discharge_battery(), veh_app_interact::draw_info(), fuel_capacity(), fuel_left(), veh_app_interact::init_ui_windows(), is_powergrid(), item::process_link(), refresh(), item::reset_link(), and search_connected_batteries().
| std::vector<int> vehicle::cable_ports |
Definition at line 2196 of file vehicle.h.
Referenced by item::process_link(), refresh(), and item::reset_link().
| bool vehicle::camera_on = false |
Definition at line 2359 of file vehicle.h.
Referenced by build_electronics_menu(), map::build_seen_cache(), power_parts(), refresh(), and split_vehicles().
| bool vehicle::check_environmental_effects = false |
Definition at line 2365 of file vehicle.h.
Referenced by gain_moves(), part_collision(), and refresh().
|
mutableprivate |
Definition at line 2332 of file vehicle.h.
Referenced by damage_direct(), enable_refresh(), install_part(), open_or_close(), part_removal_cleanup(), remove_part(), and suspend_refresh().
|
mutableprivate |
Definition at line 2326 of file vehicle.h.
Referenced by coeff_air_drag(), enable_refresh(), open_or_close(), part_removal_cleanup(), refresh(), and suspend_refresh().
|
mutableprivate |
Definition at line 2325 of file vehicle.h.
Referenced by coeff_rolling_drag(), enable_refresh(), invalidate_mass(), and suspend_refresh().
|
mutableprivate |
Definition at line 2327 of file vehicle.h.
Referenced by can_float(), coeff_water_drag(), enable_refresh(), invalidate_mass(), suspend_refresh(), water_draft(), and water_hull_height().
|
mutableprivate |
Definition at line 2107 of file vehicle.h.
Referenced by coeff_air_drag().
|
mutableprivate |
Definition at line 2108 of file vehicle.h.
Referenced by coeff_rolling_drag().
|
mutableprivate |
Definition at line 2109 of file vehicle.h.
Referenced by coeff_water_drag().
| std::set<point> vehicle::collision_check_points |
Definition at line 992 of file vehicle.h.
Referenced by get_debug_overlay_data(), immediate_path(), and stop_autodriving().
| std::vector<int> vehicle::control_req_parts |
Definition at line 2198 of file vehicle.h.
Referenced by can_control_in_air(), can_control_on_land(), and refresh().
| int vehicle::cruise_velocity = 0 |
Definition at line 2284 of file vehicle.h.
Referenced by game::calc_driving_offset(), consume_fuel(), control_engines(), crash_terrain_around(), cruise_thrust(), do_autodrive(), gain_moves(), handbrake(), idle(), print_speed_gauge(), smart_controller_handle_turn(), split_vehicles(), stop_autodriving(), thrust(), display::vehicle_cruise_text_color(), and wait().
|
mutableprivate |
Definition at line 2110 of file vehicle.h.
Referenced by can_float(), coeff_water_drag(), and water_draft().
|
private |
Definition at line 2125 of file vehicle.h.
Referenced by refresh(), remove_fake_parts(), and update_active_fakes().
| std::vector<int> vehicle::emitters |
| bool vehicle::engine_on = false |
Definition at line 2352 of file vehicle.h.
Referenced by activate_animal_follow(), activate_magical_follow(), build_interact_menu(), consumption_per_hour(), control_engines(), game::control_vehicle(), enable_patrol(), ground_acceleration(), idle(), init_state(), install_part(), noise_and_smoke(), power_parts(), map::process_items_in_vehicle(), iuse::remoteveh(), remove_part(), rotor_acceleration(), smart_controller_handle_turn(), split_vehicles(), activity_handlers::start_engines_finish(), static_drag(), stop_engines(), tell_magic_veh_stop_following(), tell_veh_stop_following(), thrust(), toggle_autopilot(), total_alternator_epower(), total_engine_epower(), update_alternator_load(), and water_acceleration().
| std::vector<int> vehicle::engines |
Definition at line 2173 of file vehicle.h.
Referenced by basic_consumption(), build_interact_menu(), control_engines(), fuel_usage(), has_available_electric_engine(), has_engine_conflict(), has_engine_type(), has_engine_type_not(), init_state(), is_alternator_on(), noise_and_smoke(), print_fuel_indicators(), refresh(), remove_carried_vehicle(), remove_part(), smart_controller_handle_turn(), start_engines(), activity_handlers::start_engines_finish(), stop_engines(), thrust(), total_engine_epower(), total_power(), update_alternator_load(), and display::vehicle_fuel_percent_text_color().
| units::power vehicle::extra_drag = 0_W |
Definition at line 2298 of file vehicle.h.
Referenced by refresh(), static_drag(), and update_alternator_load().
| tileray vehicle::face |
Definition at line 2312 of file vehicle.h.
Referenced by act_on_map(), allow_auto_turn_on_rails(), allow_manual_turn_on_rails(), do_towing_move(), face_vec(), map::generate_lightmap(), get_bounding_box(), get_debug_overlay_data(), get_display_of_tile(), get_points(), game::grabbed_veh_move(), immediate_path(), make_start_node(), merge_rackable_vehicle(), map::move_vehicle(), game::moving_vehicle_dismount(), orient_part(), possibly_recover_from_skid(), remove_carried_vehicle(), restore_folded_parts(), monster::shove_vehicle(), slowdown(), split_vehicles(), stop(), thrust(), vehicle(), display::vehicle_azimuth_text(), and npc::vehicle_danger().
| std::vector<int> vehicle::fake_parts |
Definition at line 2197 of file vehicle.h.
Referenced by part_count_real_cached(), refresh(), remove_fake_parts(), and update_active_fakes().
| std::vector<int> vehicle::floating |
Definition at line 2189 of file vehicle.h.
Referenced by act_on_map(), coeff_water_drag(), veh_interact::display_stats(), refresh(), and wheel_state_description().
|
private |
Definition at line 2341 of file vehicle.h.
Referenced by is_flyable(), set_flyable(), would_install_prevent_flyable(), would_removal_prevent_flyable(), and would_repair_prevent_flyable().
| point vehicle::front_left |
Definition at line 2306 of file vehicle.h.
Referenced by immediate_path(), and refresh().
| point vehicle::front_right |
Definition at line 2307 of file vehicle.h.
Referenced by immediate_path(), and refresh().
| std::vector<int> vehicle::fuel_containers |
Definition at line 2191 of file vehicle.h.
Referenced by fuel_left(), refresh(), and slow_leak().
| std::map<itype_id, units::energy> vehicle::fuel_remainder |
Definition at line 2214 of file vehicle.h.
Referenced by consume_fuel().
| std::map<itype_id, units::energy> vehicle::fuel_used_last_turn |
Definition at line 2215 of file vehicle.h.
Referenced by consume_fuel(), gain_moves(), and print_fuel_indicators().
| std::vector<int> vehicle::funnels |
Definition at line 2179 of file vehicle.h.
Referenced by refresh(), and update_time().
| bool vehicle::has_enabled_smart_controller = false |
Definition at line 2227 of file vehicle.h.
Referenced by build_interact_menu(), disable_smart_controller_if_needed(), install_part(), refresh(), and smart_controller_handle_turn().
|
mutableprivate |
Definition at line 2111 of file vehicle.h.
Referenced by can_float(), coeff_water_drag(), and water_hull_height().
|
mutableprivate |
Definition at line 2335 of file vehicle.h.
Referenced by act_on_map(), check_falling_or_floating(), consume_fuel(), is_in_water(), is_watercraft(), k_traction(), pldrive(), steering_effectiveness(), and thrust().
|
mutableprivate |
Definition at line 2338 of file vehicle.h.
Referenced by check_falling_or_floating(), is_in_water(), and is_watercraft().
| bool vehicle::insides_dirty = true |
Definition at line 2367 of file vehicle.h.
Referenced by damage_direct(), open_or_close(), refresh(), and refresh_insides().
| bool vehicle::is_alarm_on = false |
Definition at line 2358 of file vehicle.h.
Referenced by alarm(), build_interact_menu(), hotwire_car_activity_actor::finish(), hackveh(), idle(), power_parts(), and smash_security_system().
| bool vehicle::is_autodriving = false |
Definition at line 2347 of file vehicle.h.
Referenced by game::control_vehicle(), damage_direct(), do_autodrive(), autodrive_activity_actor::start(), and stop_autodriving().
| bool vehicle::is_falling = false |
Definition at line 2369 of file vehicle.h.
Referenced by act_on_map(), check_falling_or_floating(), collision(), gain_moves(), game::grabbed_veh_move(), map::move_vehicle(), on_move(), slowdown(), and wait().
|
mutableprivate |
Definition at line 2340 of file vehicle.h.
Referenced by acceleration(), act_on_map(), check_falling_or_floating(), check_is_heli_landed(), is_flying_in_air(), k_traction(), level_vehicle(), max_velocity(), rotor_acceleration(), safe_velocity(), set_flying(), slowdown(), smart_controller_handle_turn(), steering_effectiveness(), and thrust().
| bool vehicle::is_following = false |
Definition at line 2348 of file vehicle.h.
Referenced by activate_animal_follow(), activate_magical_follow(), game::chat(), game::control_vehicle(), gain_moves(), idle(), selfdrive(), stop_autodriving(), tell_magic_veh_stop_following(), tell_veh_stop_following(), toggle_autopilot(), and map::vehmove().
| bool vehicle::is_locked = false |
Definition at line 2356 of file vehicle.h.
Referenced by build_interact_menu(), game::control_vehicle(), hotwire_car_activity_actor::finish(), veh_menu::get_uilist_entries(), hackveh(), init_state(), and unlock().
| bool vehicle::is_on_ramp = false |
Definition at line 2345 of file vehicle.h.
Referenced by map::displace_vehicle(), gain_moves(), game::grabbed_veh_move(), level_vehicle(), and pldrive().
| bool vehicle::is_patrolling = false |
Definition at line 2349 of file vehicle.h.
Referenced by autopilot_patrol(), game::control_vehicle(), drive_to_local_target(), enable_patrol(), gain_moves(), idle(), stop_autodriving(), toggle_autopilot(), and map::vehmove().
| std::set<label> vehicle::labels |
Definition at line 2210 of file vehicle.h.
Referenced by vpart_position::get_label(), remove_part(), vpart_position::set_label(), shift_parts(), and split_vehicles().
| units::angle vehicle::last_turn = 0_degrees |
Definition at line 2293 of file vehicle.h.
Referenced by handbrake(), map::move_vehicle(), possibly_recover_from_skid(), stop(), and turn().
| time_point vehicle::last_update = calendar::before_time_starts |
Definition at line 2266 of file vehicle.h.
Referenced by init_state(), place_appliance(), restore_folded_parts(), and update_time().
| units::power vehicle::linked_item_epower_this_turn |
Definition at line 1477 of file vehicle.h.
Referenced by idle(), net_battery_charge_rate(), item::process_link(), unlink_cables(), and link_up_actor::use().
| std::vector<int> vehicle::loose_parts |
Definition at line 2182 of file vehicle.h.
Referenced by gain_moves(), get_connected_vehicles(), get_remote_part(), refresh(), and shed_loose_parts().
Definition at line 2216 of file vehicle.h.
Referenced by anonymous_namespace{map.cpp}::_add_vehicle_to_list(), zone_manager::create_vehicle_loot_zone(), map::deregister_vehicle_zone(), map::get_vehicle_zones(), map::loadn(), merge_rackable_vehicle(), refresh_zones(), remove_part(), vehicle_prototype::save_vehicle_as_prototype(), shift_parts(), and split_vehicles().
| bool vehicle::magic = false |
Definition at line 2219 of file vehicle.h.
Referenced by break_off(), game::chat(), damage_direct(), game::exam_vehicle(), merge_vehicle_parts(), remove_part(), selfdrive(), shed_loose_parts(), tell_magic_veh_stop_following(), tell_magic_veh_to_follow(), and unlink_cables().
|
mutableprivate |
Definition at line 2234 of file vehicle.h.
Referenced by calc_mass_center(), and total_mass().
|
mutableprivate |
Definition at line 2243 of file vehicle.h.
Referenced by calc_mass_center(), and local_center_of_mass().
|
mutableprivate |
Definition at line 2323 of file vehicle.h.
Referenced by calc_mass_center(), enable_refresh(), invalidate_mass(), local_center_of_mass(), and suspend_refresh().
|
mutableprivate |
Definition at line 2242 of file vehicle.h.
Referenced by calc_mass_center(), and rotated_center_of_mass().
|
mutableprivate |
Definition at line 2322 of file vehicle.h.
Referenced by calc_mass_center(), enable_refresh(), invalidate_mass(), and suspend_refresh().
|
mutableprivate |
Definition at line 2321 of file vehicle.h.
Referenced by calc_mass_center(), enable_refresh(), invalidate_mass(), suspend_refresh(), and total_mass().
|
mutableprivate |
Definition at line 2240 of file vehicle.h.
Referenced by coeff_air_drag(), coeff_water_drag(), drive_to_local_target(), refresh(), and set_tow_directions().
|
mutableprivate |
Definition at line 2241 of file vehicle.h.
Referenced by coeff_air_drag(), coeff_water_drag(), refresh(), and set_tow_directions().
| tileray vehicle::move |
Definition at line 2314 of file vehicle.h.
Referenced by act_on_map(), do_towing_move(), move_vec(), map::move_vehicle(), part_collision(), pldrive(), possibly_recover_from_skid(), selfdrive(), monster::shove_vehicle(), slowdown(), split_vehicles(), stop(), vehicle(), and map::vehicle_vehicle_collision().
| std::vector<int> vehicle::mufflers |
Definition at line 2193 of file vehicle.h.
Referenced by get_exhaust_part(), and refresh().
| std::string vehicle::name |
Definition at line 2201 of file vehicle.h.
Referenced by act_on_map(), overmapbuffer::add_vehicle(), map::add_vehicle_to_map(), automatic_fire_turret(), break_off(), build_bike_rack_menu(), build_electronics_menu(), MapExtras::burned_ground_parser(), close(), doors::close_door(), coeff_air_drag(), collision(), veh_interact::complete_vehicle(), control_engines(), game::control_vehicle(), veh_app_interact::create_or_get_ui_adaptor(), damage_direct(), decrement_summon_timer(), map::detach_vehicle(), disp_name(), map::displace_vehicle(), veh_interact::display_name(), veh_interact::do_rename(), construct::done_vehicle(), drive_to_local_target(), game::exam_vehicle(), explode_fuel(), optional_vpart_position::extended_description(), vehicles::finalize_prototypes(), find_vehicles_to_rack(), find_vehicles_to_unrack(), bikerack_racking_activity_actor::finish(), bikerack_unracking_activity_actor::finish(), vehicle_folding_activity_actor::fold_vehicle(), get_folded_item(), game::grabbed_veh_move(), ground_acceleration(), handbrake(), handle_trap(), idle(), advanced_inv_area::init(), is_towed(), is_towing(), k_traction(), lift_thrust_of_rotorcraft(), item::link_to(), lock(), doors::lock_door(), max_ground_velocity(), max_water_velocity(), merge_appliance_into_grid(), merge_rackable_vehicle(), avatar_action::move(), map::move_vehicle(), game::moving_vehicle_dismount(), open(), open(), part_collision(), part_removal_cleanup(), pickveh(), place_appliance(), place_spawn_items(), pldrive(), possibly_recover_from_skid(), Character::pour_into(), power_parts(), game::print_vehicle_info(), process_vehicle_items(), put_into_vehicle(), advanced_inventory::query_destination(), advanced_inventory::redraw_pane(), veh_app_interact::remove(), remove_carried_vehicle(), remove_part(), veh_app_interact::rename(), veh_utils::repair_part(), separate_from_grid(), map::shake_vehicle(), shed_loose_parts(), slowdown(), split_vehicles(), start_engines(), activity_handlers::start_engines_finish(), thrust(), vehicle_unfolding_activity_actor::unfold_vehicle(), unlock(), doors::unlock_door(), update_time(), link_up_actor::use(), use_autoclave(), use_dishwasher(), use_washing_machine(), vehicle(), map::vehicle_vehicle_collision(), and water_acceleration().
|
private |
Definition at line 2317 of file vehicle.h.
Referenced by enable_refresh(), refresh(), and suspend_refresh().
|
mutableprivate |
Definition at line 2116 of file vehicle.h.
Referenced by get_points().
|
mutableprivate |
Definition at line 2114 of file vehicle.h.
Referenced by advance_precalc_mounts(), get_points(), and refresh().
|
mutableprivate |
Definition at line 2118 of file vehicle.h.
Referenced by get_points().
| float vehicle::of_turn = 0.0f |
Definition at line 2295 of file vehicle.h.
Referenced by act_on_map(), gain_moves(), map::vehicle_vehicle_collision(), and map::vehproceed().
| float vehicle::of_turn_carry = 0.0f |
Definition at line 2297 of file vehicle.h.
Referenced by act_on_map(), gain_moves(), and stop().
| faction_id vehicle::old_owner = faction_id::NULL_ID() |
Definition at line 2104 of file vehicle.h.
Referenced by get_old_owner(), has_old_owner(), is_old_owner(), remove_carried_vehicle(), remove_old_owner(), set_old_owner(), and split_vehicles().
| int vehicle::om_id = 0 |
Definition at line 2288 of file vehicle.h.
Referenced by overmapbuffer::add_vehicle(), overmapbuffer::move_vehicle(), and overmapbuffer::remove_vehicle().
| faction_id vehicle::owner = faction_id::NULL_ID() |
Definition at line 2102 of file vehicle.h.
Referenced by get_owner(), get_owner_name(), has_owner(), is_owned_by(), remove_carried_vehicle(), set_owner(), and split_vehicles().
|
private |
Definition at line 2121 of file vehicle.h.
Referenced by activate_animal_follow(), activate_magical_follow(), active_reactor_epower(), advance_precalc_mounts(), all_parts_at_location(), assign_seat(), balanced_wheel_config(), basic_consumption(), battery_left(), battery_power_level(), break_off(), bub_part_pos(), build_interact_menu(), can_close(), can_control_in_air(), can_control_on_land(), can_enable(), can_mount(), can_unmount(), coeff_air_drag(), coeff_rolling_drag(), collision(), control_engines(), damage(), do_remove_part_actual(), drain(), drain_energy(), exhaust_dest(), find_and_split_vehicles(), find_lines_of_parts(), find_vehicles_to_unrack(), fuel_capacity(), fuel_items_left(), fuel_left(), fuel_usage(), fuels_left(), get_bounding_box(), get_display_of_tile(), get_edge_info(), get_exhaust_part(), get_folded_item(), get_harnessed_animal(), get_non_fake_part(), get_passenger(), get_remote_part(), global_part_pos3(), has_available_electric_engine(), has_engine_conflict(), has_engine_type(), has_engine_type_not(), idle(), index_of_part(), init_state(), install_part(), invalidate_towing(), is_alternator_on(), is_connected(), level_vehicle(), lift_thrust_of_rotorcraft(), lights(), lock_or_unlock(), max_reactor_epower(), merge_rackable_vehicle(), merge_vehicle_parts(), next_part_to_close(), next_part_to_lock(), next_part_to_open(), next_part_to_unlock(), noise_and_smoke(), open_all_at(), open_or_close(), part(), part_base(), part_collision(), part_count(), part_count_real(), part_count_real_cached(), part_displayed_at(), part_has_lock(), part_removal_cleanup(), parts_at_relative(), place_spawn_items(), power_parts(), precalc_mounts(), precalculate_vehicle_turning(), precollision_check(), print_fuel_indicators(), print_part_list(), print_vparts_descs(), real_parts(), refresh(), refresh_pivot(), remove_carried_vehicle(), remove_fake_parts(), remove_part(), restore_folded_parts(), roof_at_part(), set_tow_directions(), shift_if_needed(), shift_parts(), slow_leak(), smart_controller_handle_turn(), smash(), split_vehicles(), start_engines(), steering_effectiveness(), stop_engines(), thrust(), total_accessory_epower(), total_alternator_epower(), total_engine_epower(), total_power(), total_solar_epower(), total_water_wheel_epower(), total_wind_epower(), turrets(), turrets_set_mode(), turrets_set_targeting(), unlink_cables(), unlock(), update_active_fakes(), update_alternator_load(), update_time(), use_autoclave(), use_dishwasher(), use_harness(), use_monster_capture(), use_washing_machine(), and wheel_area().
| std::array<point, 2> vehicle::pivot_anchor |
Definition at line 2310 of file vehicle.h.
Referenced by advance_precalc_mounts(), veh_interact::complete_vehicle(), coord_translate(), item::link_to(), merge_appliance_into_grid(), mount_to_tripoint(), pivot_displacement(), precalc_mounts(), refresh(), restore_folded_parts(), separate_from_grid(), and shift_parts().
|
mutableprivate |
Definition at line 2236 of file vehicle.h.
Referenced by pivot_point(), and refresh_pivot().
|
mutableprivate |
Definition at line 2320 of file vehicle.h.
Referenced by damage_direct(), invalidate_mass(), pivot_point(), and refresh_pivot().
| std::array<units::angle, 2> vehicle::pivot_rotation = { { 0_degrees, 0_degrees } } |
Definition at line 2303 of file vehicle.h.
Referenced by advance_precalc_mounts(), coord_translate(), item::link_to(), mount_to_tripoint(), pivot_displacement(), precalc_mounts(), refresh(), and restore_folded_parts().
| std::vector<int> vehicle::planters |
| point vehicle::pos = point_zero |
Position of the vehicle inside the submap that contains the vehicle.
This will (nearly) always be in the range (0...SEEX-1). Note that vehicles are "moved" by map::displace_vehicle. You should not set them directly, except when initializing the vehicle or during mapgen.
Definition at line 2274 of file vehicle.h.
Referenced by advance_precalc_mounts(), automatic_fire_turret(), backfire(), break_off(), build_interact_menu(), can_enable(), veh_interact::complete_vehicle(), vehicle::autodrive_controller::compute_profile(), control_doors(), decrement_summon_timer(), enclosed_at(), engine_cold_factor(), find_vehicle(), map::get_moving_vehicle_targets(), get_parts_at(), global_pos3(), game::grabbed_veh_move(), has_part(), merge_appliance_into_grid(), open_or_close(), game::place_vehicle_nearby(), place_zones(), reload_seeds(), remove_part(), separate_from_grid(), start_engine(), total_solar_epower(), total_water_wheel_epower(), total_wind_epower(), turret_query(), turrets_set_targeting(), update_time(), use_harness(), and use_monster_capture().
| bool vehicle::precollision_on = true |
Definition at line 2361 of file vehicle.h.
Referenced by precollision_check(), and toggle_autopilot().
| bounding_box vehicle::rail_wheel_bounding_box |
Definition at line 2305 of file vehicle.h.
Referenced by is_wheel_state_correct_to_turn_on_rails(), and refresh().
| std::vector<int> vehicle::rail_wheelcache |
Definition at line 2185 of file vehicle.h.
Referenced by allow_auto_turn_on_rails(), allow_manual_turn_on_rails(), can_use_rails(), and refresh().
| std::vector<int> vehicle::reactors |
Definition at line 2174 of file vehicle.h.
Referenced by active_reactor_epower(), veh_app_interact::draw_info(), veh_app_interact::init_ui_windows(), is_powergrid(), max_reactor_epower(), power_parts(), and refresh().
| std::map<point, std::vector<int> > vehicle::relative_parts |
Definition at line 2209 of file vehicle.h.
Referenced by exhaust_dest(), get_edge_info(), get_points(), parts_at_relative(), and refresh().
|
private |
Definition at line 2342 of file vehicle.h.
Referenced by act_on_map(), get_z_change(), and thrust().
| std::vector<int> vehicle::rotors |
Definition at line 2184 of file vehicle.h.
Referenced by damage_direct(), is_rotorcraft(), lift_thrust_of_rotorcraft(), refresh(), would_install_prevent_flyable(), would_removal_prevent_flyable(), and would_repair_prevent_flyable().
| bool vehicle::skidding = false |
Definition at line 2363 of file vehicle.h.
Referenced by act_on_map(), game::calc_driving_offset(), do_autodrive(), do_towing_move(), ground_acceleration(), handbrake(), map::move_vehicle(), on_move(), part_collision(), pldrive(), possibly_recover_from_skid(), selfdrive(), monster::shove_vehicle(), split_vehicles(), stop(), thrust(), map::unboard_vehicle(), velo_vec(), and water_acceleration().
| tripoint vehicle::sm_pos = tripoint_zero |
Submap coordinates of the currently loaded submap (see game::m) that contains this vehicle.
These values are changed when the map shifts (but the vehicle is not actually moved than, it also stays on the same submap, only the relative coordinates in map::grid have changed). These coordinates must always refer to the submap in map::grid that contains this vehicle. When the vehicle is really moved (by map::displace_vehicle), set_submap_moved is called and updates these values, when the map is only shifted or when a submap is loaded into the map the values are directly set. The vehicles position does not change therefore no call to set_submap_moved is required.
Definition at line 2261 of file vehicle.h.
Referenced by act_on_map(), map::add_vehicle(), check_heli_ascend(), map::detach_vehicle(), global_pos3(), map::loadn(), merge_rackable_vehicle(), map::move_vehicle(), on_move(), open_or_close(), part_collision(), game::place_vehicle_nearby(), precollision_check(), remove_part(), set_submap_moved(), split_vehicles(), update_time(), and map::vehicle_vehicle_collision().
| std::optional<smart_controller_config> vehicle::smart_controller_cfg = std::nullopt |
Definition at line 2226 of file vehicle.h.
Referenced by build_interact_menu(), and smart_controller_handle_turn().
| std::optional<smart_controller_cache> vehicle::smart_controller_state = std::nullopt |
Definition at line 2224 of file vehicle.h.
Referenced by refresh(), and smart_controller_handle_turn().
| std::vector<int> vehicle::solar_panels |
Definition at line 2175 of file vehicle.h.
Referenced by veh_app_interact::draw_info(), veh_app_interact::init_ui_windows(), is_powergrid(), refresh(), total_solar_epower(), and update_time().
| std::vector<int> vehicle::speciality |
Definition at line 2188 of file vehicle.h.
Referenced by has_security_working(), refresh(), and smash_security_system().
| std::vector<int> vehicle::steering |
Definition at line 2186 of file vehicle.h.
Referenced by refresh(), steering_effectiveness(), and veh_interact::update_part_requirements().
| std::optional<time_duration> vehicle::summon_time_limit = std::nullopt |
Definition at line 2221 of file vehicle.h.
Referenced by decrement_summon_timer().
| std::set<std::string> vehicle::tags |
Definition at line 2211 of file vehicle.h.
Referenced by add_tag(), has_tag(), and player_in_control().
| std::optional<time_point> vehicle::theft_time |
Definition at line 2300 of file vehicle.h.
Referenced by handle_potential_theft(), remove_old_owner(), and set_old_owner().
| towing_data vehicle::tow_data |
Definition at line 2308 of file vehicle.h.
Referenced by do_towing_move(), ground_acceleration(), invalidate_towing(), is_towed(), is_towing(), item::link_to(), map::move_vehicle(), no_towing_slack(), set_tow_directions(), towing_data::set_towing(), slowdown(), split_vehicles(), static_drag(), thrust(), tow_cable_too_far(), game::validate_linked_vehicles(), and water_acceleration().
| bool vehicle::tracking_on = false |
Definition at line 2354 of file vehicle.h.
Referenced by build_interact_menu(), map::detach_vehicle(), veh_interact::do_rename(), get_folded_item(), map::loadn(), merge_rackable_vehicle(), veh_app_interact::rename(), set_submap_moved(), split_vehicles(), and toggle_tracking().
| units::angle vehicle::turn_dir = 0_degrees |
Definition at line 2291 of file vehicle.h.
Referenced by act_on_map(), map::add_vehicle_to_map(), allow_auto_turn_on_rails(), allow_manual_turn_on_rails(), vehicle::autodrive_controller::check_collision_zone(), veh_interact::complete_vehicle(), dir_vec(), do_autodrive(), get_bounding_box(), game::grabbed_veh_move(), merge_appliance_into_grid(), map::move_vehicle(), pldrive(), restore_folded_parts(), selfdrive(), separate_from_grid(), split_vehicles(), thrust(), and turn().
| std::vector<int> vehicle::turret_locations |
| vproto_id vehicle::type |
Type of the vehicle as it was spawned.
This will never change, but it can be an invalid type (e.g. if the definition of the prototype has been removed from json or if it has been spawned with the default constructor).
Definition at line 2207 of file vehicle.h.
Referenced by map::add_vehicle_to_map(), damage(), damage_all(), damage_direct(), explode_fuel(), vehicles::finalize_prototypes(), install_part(), part_collision(), place_spawn_items(), place_zones(), print_speed_gauge(), remove_part(), spew_field(), use_charges(), and vehicle().
| unsigned char vehicle::vehicle_noise = 0 |
Definition at line 2374 of file vehicle.h.
Referenced by noise_and_smoke(), sounds::process_sound_markers(), and stop_engines().
| int vehicle::velocity = 0 |
Definition at line 2276 of file vehicle.h.
Referenced by act_on_map(), game::calc_driving_offset(), can_do_activity_there(), check_heli_ascend(), check_heli_descend(), collision(), consume_fuel(), control_engines(), crash_terrain_around(), current_acceleration(), do_autodrive(), do_towing_move(), drive_to_local_target(), exhaust_dest(), vehicle_folding_activity_actor::fold_vehicle(), forward_velocity(), gain_moves(), handbrake(), handling_difficulty(), idle(), immediate_path(), is_moving(), is_wheel_state_correct_to_turn_on_rails(), make_start_node(), avatar_action::move(), map::move_vehicle(), game::moving_vehicle_dismount(), noise_and_smoke(), on_move(), part_collision(), Character::pause(), Character::perform_technique(), pldrive(), possibly_recover_from_skid(), precalculate_vehicle_turning(), print_speed_gauge(), item::process_link(), selfdrive(), map::shake_vehicle(), monster::shove_vehicle(), smart_controller_handle_turn(), split_vehicles(), activity_handlers::start_engines_finish(), stop(), strain(), thrust(), transform_terrain(), turn(), display::vehicle_cruise_text_color(), map::vehicle_vehicle_collision(), velo_vec(), and wait().
| int vehicle::vertical_velocity = 0 |
Definition at line 2286 of file vehicle.h.
Referenced by act_on_map(), collision(), map::move_vehicle(), part_collision(), monster::shove_vehicle(), split_vehicles(), and map::vehicle_vehicle_collision().
| std::vector<int> vehicle::water_wheels |
Definition at line 2177 of file vehicle.h.
Referenced by veh_app_interact::draw_info(), veh_app_interact::init_ui_windows(), is_powergrid(), refresh(), total_water_wheel_epower(), and update_time().
| std::vector<int> vehicle::wheelcache |
Definition at line 2183 of file vehicle.h.
Referenced by average_offroad_rating(), balanced_wheel_config(), can_use_rails(), check_falling_or_floating(), coeff_rolling_drag(), veh_interact::display_stats(), game::grabbed_veh_move(), init_state(), is_watercraft(), map::move_vehicle(), precalculate_vehicle_turning(), refresh(), refresh_pivot(), sufficient_wheel_config(), map::vehicle_wheel_traction(), game::walk_move(), wheel_area(), and wheel_state_description().
| std::vector<int> vehicle::wind_turbines |
Definition at line 2176 of file vehicle.h.
Referenced by veh_app_interact::draw_info(), veh_app_interact::init_ui_windows(), is_powergrid(), refresh(), total_wind_epower(), and update_time().
| bool vehicle::zones_dirty = true |
Definition at line 2371 of file vehicle.h.
Referenced by map::check_vehicle_zones(), map::displace_vehicle(), merge_rackable_vehicle(), refresh(), refresh_zones(), remove_part(), map::shift(), and split_vehicles().